text
stringlengths
14
410k
label
int32
0
9
private List<N> searchConnections(N current, List<N> nodes, List<N> found) { List<Edge<N>> edges = edgesFrom(current); for(Edge<N> edge : edges) { if(nodes.contains(edge.to)) { nodes.remove(edge.to); found.add(edge.to); found = searchConnections(edge.to, nodes, found); } } edges = edgesTo(curr...
4
public void traiter(LigneDeCaisses ligneDeCaisses, Echeancier echeancier) { nbEssais++; Evenement e; Caisse nCaisse; long d; if(direction == -1){ nCaisse = ligneDeCaisses.caisseAGaucheDe(caisse.numero()); }else{ nCaisse = ligneDeCaisses.caisseADroiteDe(caisse.numero()); ...
9
public void setHiddenWithPanel(boolean hiddenWithPanel) { this.hiddenWithPanel = hiddenWithPanel; }
0
public void initialise(boolean[][] world) throws PatternFormatException { String[] cellParts = cells.split(" "); for (int i=0;i<cellParts.length;i++) { char[] currCells = cellParts[i].toCharArray(); for (int j=0;j<currCells.length;j++) { if (currCells[j] != '1' && currCells[j] !=...
5
public void fireEnemiesLasers(){ for(Munchkin enemy : munchkins){ if(enemy != null){ if(enemy.getCenterPointX() >= player.posX - player.width / 2 && enemy.getCenterPointX() <= player.posX + player.width){ enemy.shoot(this); } } } for(UFO enemy : ufos){ if(enemy != null){ if(enemy.g...
8
public boolean actualizaEquipo(int id_equipo, int numeroInveInterInfo, int numInvUnam, String descrip, String modelo, String marca, String serie, String familia, String tipo, String prove, String clase, String uso, String nivel, String edoFisico, String area, String institu, String fecha, String...
2
protected void printSigners(Class<?> clazz) { print("clazz.getSigners(): "); if(clazz.getSigners() == null) print(clazz.getSigners()); if(clazz.getSigners() != null) { print(); if(clazz.getSigners().length == 0) print("none"); if(cl...
6
private DefaultTableModel tableCreate(int tempMonths, int currentYear) { DefaultTableModel table = new DefaultTableModel(new Object[0][0],new String[0][0]); this.cal = new GregorianCalendar(currentYear, tempMonths - 1, 1); while (tempMonths == this.cal.get(Calendar.MONTH) + 1) { String tempKey = this.cal.get(...
3
public DiceHand(String rawInput, String rollee, int modifier, ArrayList<Die> dice) { this.dice = dice; this.modifier = modifier; this.rollee = rollee; this.rawInput = rawInput; this.result = modifier; for (int i=0; i<dice.size(); i++) { if (d...
2
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TradeStop other = (TradeStop) obj; if (orders == null) { if (other.orders != null) return false; } else if (!orders.equals(other.orders)...
9
@Override public void run() { /* * refreshing the Audio Panel */ sf.audioPanel.removeAll(); sf.studentPanel.removeAll(); sf.studentPanel=new JPanel(); sf.studentPanel.setBackground(Color.WHITE); if(Integer.parseInt(sf.studentNumberComboBox.getSelectedItem().toString())<5 || Student.studentL...
8
public static Grammar getUselessProductionlessGrammar(Grammar grammar) { Grammar g = new ContextFreeGrammar(); g.setStartVariable(grammar.getStartVariable()); if (!getCompleteUsefulVariableSet(grammar).contains( grammar.getStartVariable())) return g; grammar = getTerminalGrammar(grammar); VariableDepen...
3
public List<Instance> readData() { ArrayList<Instance> instances = new ArrayList<Instance>(); while (this._scanner.hasNextLine()) { String line = this._scanner.nextLine(); if (line.trim().length() == 0) continue; FeatureVector feature_vector = new FeatureVector(); // Divide the line int...
7
public static List search(TagState state, Expression queryRoot) { int docCount = 0; int imgCount = 0; int tagCount = 0; //TODO Add support for scope List results = new ArrayList(32); List docs = state.getDocuments(); for (Iterator docIt = docs.iterator(); docIt.h...
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypeName other = (TypeName) obj; if (packageName == null) { if (other.packageName != null) return false; } else if (!packageName.equa...
9
public void createQuestion() { // Set Values questionText = QuestionTxt_txtbx.getText(); Answer1Text = Answer1_txtbx.getText(); Answer2Text = Answer2_txtbx.getText(); Answer3Text = Answer3_txtbx.getText(); Answer4Text = Answer4_txtbx.getText(); ...
1
public static Locale findLocale(String filename) { String regex = "_[a-z]{2}(_[A-Z]{2}){0,1}\\."; Pattern pattern = Pattern.compile(regex); Matcher m = pattern.matcher(filename); if (m.find()) { String l = m.group(0); l = l.substring(1, l.length() - 1); return LocaleUtils.toLocale(l); } re...
1
@Test public void WhenLocalhostReducesPath_ExpectRemovedLevels() throws UnknownHostException { int refMax = Integer.MAX_VALUE; Host localhost = new PGridHost("127.0.0.1", 3000); localhost.setHostPath("0010"); RoutingTable routingTable = new RoutingTable(); routingTable.setLoc...
1
public static void handlePawnPromotion(int myXCoor, int myYCoor){ int targetRank; if (userColor.equals("W")){ targetRank = 0; } else{ targetRank = 7; } if (myYCoor == targetRank){ System.out.println(clearScreen() + "What would you like to promote your pawn to?"); System.out.println("[1] Bishop\n...
6
protected void generateOperationLines(List<AssemblyLine> lines, int op, Data dest, Data value) { switch (op) { case Token.ASSIGN: lines.add(new Instruction(Opcode.SET, dest, value)); break; case Token.PLUSASSIGN: ...
8
@Override public void stateChanged(ChangeEvent e) { IntSpinner sp = (IntSpinner) e.getSource(); int dim = sp.getInt(); if (formula == null || dim != formula.length) { String[] newFormula = new String[dim]; int md = Math.min(formula == null ? 1 : formula.length, newFormula.length); for (int i = 0; ...
5
public static Cons walkADeclaration(Symbol variable, Stella_Object typetree, Stella_Object value, boolean inputparameterP) { { StandardObject sourcetype = null; StandardObject targettype = Stella_Object.safeYieldTypeSpecifier(typetree); Surrogate methodownertype = ((((MethodSlot)(Stella.$METHODBEINGWALK...
7
public static int[] lcp(int[] sa) { int n = sa.length; int[] rank = new int[n]; for (int i = 0; i < n; i++) rank[sa[i]] = i; int[] lcp = new int[n - 1]; for (int i = 0, h = 0; i < n; i++) { if (rank[i] < n - 1) { for (int j = sa[rank[i] + 1]; Math.max(i, j) + h < cad.length && cad[i + h] == ca...
6
public Buffer getReadOnlyData() { if (bufferData == null) { return null; } // Create a read-only duplicate(). Note: this does not copy // the underlying memory, it just creates a new read-only wrapper // with its own buffer position state. // Unfortunately...
5
public void showBoard() { for (int i = 0; i < 8; i++) { if (i == 0) { System.out.print(" "); } System.out.print(" " + this.lettersV[i] + " "); } System.out.println(""); for (int i = 0; i < 8; i++) { System.out.print(this.numberH[i] + " "); for (int j = 0; j < 8; j++) { System.out.print(t...
4
@Override public void startServer() { StartGameController controller = new StartGameController(this, players); SocketServer server = new SocketServer(1234, new NewConnectionListener(controller)); if (controller.start(server)) controller.bind(new StartGameScreen(mainFrame, control...
1
public Double getElevationFor(Double longitude, Double latitude) throws IOException { if (elevationFile == null) return null; double dElevation; double dLon = longitude; double dLat = latitude; int nLon = (int) dLon; // Cut off the decimal places ...
9
@Override public void run() { init(); int frames = 0; double nsPerFrame = 1000000000.0 / 60.0; long lastFrameTime = System.nanoTime(); long lastFrame = System.currentTimeMillis(); double unProcessedTime = 0; running = true; while(running){ ...
4
@EventHandler(ignoreCancelled=true) public void onPlayerLogin(PlayerLoginEvent event) { if (event.getPlayer().hasPermission("enhancedfishing.admin")) { final String playerName = event.getPlayer().getName(); if (updater == null) return; getServer().getScheduler().runTaskLa...
6
private Key decodeKey( DataInputStream dIn) throws IOException { int keyType = dIn.read(); String format = dIn.readUTF(); String algorithm = dIn.readUTF(); byte[] enc = new byte[dIn.readInt()]; KeySpec spec; dIn.readFully(en...
9
private void setRegressionArrays(){ this.xRegression = new double[this.numberOfFrequencies]; this.yRegression = new double[2][this.numberOfFrequencies]; if(this.weightsSet)this.wRegression = new double[2][this.numberOfFrequencies]; for(int i=0; i<this.numberOfFrequencies; i++){ ...
4
public void paint(Graphics g) { if (dir == 0 || dir == 2) { g.drawImage(image, x, y, 8, 20, gameScreen); } else if (dir == 1 || dir == 3) { g.drawImage(image, x, y, 20, 8, gameScreen); } }
4
public static void main(String[] args) { new MicroScope(); }
0
public Component getListComponentForDataSection(TaskObserver taskObserver, String dataSectionName, List list, Iterator indexIterator) throws InterruptedException { if (dataSectionName == DATA_SECTION_UNKNOWN0) { return getGeneralPanel(taskObserver); } else if (dataSectionName == DATA_SECTION_VISIBLE...
6
public void updateStatsDates(User user) { String lastDate = (String) this.statsDateModel.getSelectedItem(); this.statsDateModel.removeAllElements(); for(String date : user.getAvalidbleStatsDates(getSelectedMode())) this.statsDateModel.addElement(date); this.statsDateModel.addElement(Utils.resourceBundle.get...
5
public Token molDivMod() throws OperazioneNonValidaException, ParentesiParsingException { Token x = menoUnario(); if(!(point>text.size()-1)) while(peek().ritornaTipoToken().equals(Tok.MODULO)||peek().ritornaTipoToken().equals(Tok.PER)||peek().ritornaTipoToken().equals(Tok.DIVISO)) { Token op = peek(); ...
7
protected int approxBusyTime(long time) { int SECOND = 1; int MINUTE = 60 * SECOND; // 1 minute = 60 secs int HOUR = 60 * MINUTE; // 1 hour = 60 minute int busy = (int) time / MILLI_SEC; // already in seconds // find one of the type: sec or min or hour int type...
7
public void checkPlaceableDamageAgainstMob(Monster m) { if (gameController.multiplayerMode != gameController.multiplayerMode.CLIENT) { Placeable placeable = null; try { for (String key : placeables.keySet()) { placeable = (Placeable) placeables.get(ke...
6
public static void quickSort(int[] toBeSorted, int start, int end) { if (start < end) { int key = toBeSorted[start]; int i = start, j = end; while (i < j) { while (i < j && toBeSorted[j] >= key) { j--; } if (toBeSorted[j] < key) { int tmp = toBeSorted[j]; toBeSorted[j] = toBeSorted...
8
public static BeerEntity createBeerWithNameAndDescription(String name, String description) { BeerEntity entity = new BeerEntity(); entity.setName(name); entity.setDescription(description); return entity; }
0
public synchronized boolean login(String robot_name, RobotServerHandler handler) { if (isOnline(robot_name)) { return false; } robots.put(robot_name, new Robot(robot_name, handler)); return true; }
1
public Builder id(int receivedId) { if (receivedId < 0) { log.warn("Wrong ID. receivedId ={}", id); throw new IllegalArgumentException("Id must be integer value more than 0. Received value =" + receivedId); } this.id = receivedId; return th...
1
private static void startFolkRankCreation(BookmarkReader reader, int sampleSize) { timeString = ""; System.out.println("\nStart FolkRank Calculation for Tags"); frResults = new ArrayList<int[]>(); prResults = new ArrayList<int[]>(); int size = reader.getBookmarks().size(); int trainSize = size - sampleSize;...
5
private HaveMessage(ByteBuffer buffer, int piece) { super(Type.HAVE, buffer); this.piece = piece; }
0
private static EnviroEffect engage(EnviroEffect result, Ship ship, String argument){ int moveForward = 0; int moveSide = 0; double throttle = 1; if (argument.contains("half-power")){ throttle = .5; } else if (argument.contains("third-power")){ throttle = .33; } else if (a...
9
public VenueRemovalInitiated(Venue venue) { this.venue = venue; }
0
private GetQuestionsFromMySqlDatabase getMySQLQuestionsStrategy() { return new GetQuestionsFromMySqlDatabase(hostnameTextField.getText(), databaseNameTextField.getText(), usernameTextField.getText(), passwordTextField.getText()); }
0
void output(int code, OutputStream outs) throws IOException { cur_accum &= masks[cur_bits]; if (cur_bits > 0) cur_accum |= (code << cur_bits); else cur_accum = code; cur_bits += n_bits; while (cur_bits >= 8) { ...
8
public void removeHuff(){ IteratorOnPieces iterator = (IteratorOnPieces) player.iterator(); while (iterator.hasNext()){ iterator.next(); Position position = iterator.getPosition(); if(player.getBoard().getPiece(position).getHuff()) player.getBoard().getPiece(position).setHuff(false); } }
2
private int GenerateRepot() { //String str = "" + GetHead(); try { //System.setProperty("file.encoding", "UTF-8"); //Charset. //FileWriter fw = new FileWriter(Adapter_to_config.getInstance().GetReportFileName()); OutputStreamWriter fw = new Outpu...
8
public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Digite o inicio do cpf:"); int cpf = scan.nextInt(); int cpfTemp = cpf; int d1 = 0, d2 = 0; for (int i = 9; i >= 1; i--) { int digit = cpf % 10; ...
5
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public static String whoCheck(TelnetService TN) throws InterruptedException, IOException{ String rtn=""; TN.write("sys list users"); String line=TN.readit("There are", "skjafhdkhfaldsfh"); String[] b=line.split("\n"); for (String value:b){ if (!value.trim().startsWith(">sys list")&&!value.trim().startsWith...
9
public static void writeToFile(File dest, InputStream input) { if(dest != null && dest.exists() && dest.isFile() && input != null) { } else { throw new IllegalArgumentException(); } }
4
public static void main(String[] args) { Scanner in = new Scanner(System.in); int num1 = Integer.parseInt(in.next()); double num2 = Integer.parseInt(in.next()); if (num2 == 0) { System.out.println("Error: divide by zero!"); } else { System.out.println(num...
1
protected boolean out_grouping(char [] s, int min, int max) { if (cursor >= limit) return false; char ch = current.charAt(cursor); if (ch > max || ch < min) { cursor++; return true; } ch -= min; if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) { cursor ++; return true; } return false; }
4
public void addText( String txt ) { taskOutput.setText( taskOutput.getText() + txt + "\n" ); scrollTask.getVerticalScrollBar().setValue(scrollTask.getVerticalScrollBar().getMaximum()); }
0
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // System.out.println("Starting element: " + qName + "..."); if(stack.peek().equals("tracks")) { if(qName.equals("dict")) { stack.push("newSong"); currentSong = new Song(); } } }
2
private Location findTarget2(Location location) { List<Location> adjacent = getField().adjacentLocations(location); Iterator<Location> it = adjacent.iterator(); while (it.hasNext()) { Location where = it.next(); Object character = getField().getObjectAt(where); if(weapon == null){ haveWeapon = false;...
9
protected boolean AnalyzeDocByStn(_Doc doc, String[] sentences) { TokenizeResult result; int y = doc.getYLabel(), index = 0; HashMap<Integer, Double> spVct = new HashMap<Integer, Double>(); // Collect the index and counts of features. ArrayList<_Stn> stnList = new ArrayList<_Stn>(); // sparse sentence feature...
6
protected void execute() {}
0
private void nameCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameCmbxActionPerformed tableModel.setRowCount(0); String name = ""; if (nameCmbx.getSelectedItem() != null && nameCmbx.getSelectedIndex() != 0) { name = nameCmbx.getSelectedItem().toString(); ...
5
private void setLeaf() throws Exception { //this will fill the ranges array with the number of times //each class type occurs for the instances. //System.out.println("ihere"); if (m_training != null ) { if (m_training.classAttribute().isNominal()) { FastVector tmp; //System.out.pri...
8
public int compare(final Object o1, final Object o2) { Assert.isTrue(o1 instanceof Type, o1 + " is not a Type"); Assert.isTrue(o2 instanceof Type, o2 + " is not a Type"); final Type t1 = (Type) o1; final Type t2 = (Type) o2; TypeComparator.db("Comparing " + t1 + " to " + t2); final ClassHierarchy hier = ...
2
@EventHandler public void EndermanFireResistance(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getEndermanConfig().getDouble("End...
6
public static void mouseToggle(MouseEvent e, boolean toggle) { if(e.getButton() == MouseEvent.BUTTON1) //left click Main.isMouseLeft = toggle; else if(e.getButton() == MouseEvent.BUTTON2) //middle click Main.isMouseMiddle = toggle; else if(e.getButton() == MouseEvent.BUTTON3) //right click Main.isMous...
3
public void show(FindReplaceResultsModel model) { // Lazy Instantiation if (!initialized) { initialize(); initialized = true; } this.model = model; model.setView(this); // Setup the JTable table.setModel(model); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); TableColumn co...
1
public TaskQueueStatistics(TaskAcceptor<T> taskAcceptor, TaskSupplier<T> taskSupplier) { this.taskAcceptor = taskAcceptor; this.taskSupplier = taskSupplier; }
0
public void setCounter(LongDataType value) { this.counter = value; }
0
public <T extends Data> void addDataToEntity( long someEntityId, T someData ) throws EntityAlreadHasDataException, NoSuchEntityException { //local vars DataCore db = _dataCenter.getDataCore(); Map<Class<? extends Data>, Data> entityData = db.getEntity_Data_Table().get( someEntity...
4
private void accumulate(ArcState state, double value) throws IOException { if (Double.isNaN(value)) { state.setNanSteps(state.getNanSteps() + 1); } else { switch (ConsolFun.valueOf(consolFun.get())) { case MIN: state.setAccumValue(Util.min(stat...
8
public boolean execute() { // If the input is invalid, don't bother with processing if(variables.errorFlag) {return false;} // Initialize Variables int aNot=1; variables.coeff2=1; variables.coeff1=0; int bNot=0; int c=variables.input1; variables.gcd=variables.input2; // Main loop while(true) { ...
3
public void ajustmentWeigth() { //errors and weigth adjustment for output layer for (int i = 0; i < outNodes.size(); i++) { outNodes.get(i).ajErrorOutputNode(); } Set<Node> doneNodes = new HashSet<Node>(); doneNodes.addAll(outNodes); //errors and weigth adjus...
2
@Override public void render(Graphics2D g2d, int width, int height) { drawBackground(g2d, width, height); Font f = Client.instance.translation.font.deriveFont(Font.BOLD, 80F); g2d.setFont(f); String title = Client.instance.translation.translate("gui.options" + (section != Section.MAIN ? "." + section.name().to...
8
public static void main(String[] args) { SeparateChainingHashST<String, Integer> st = new SeparateChainingHashST<String, Integer>(); for (int i = 0; !StdIn.isEmpty(); i++) { String key = StdIn.readString(); st.put(key, i); } // print keys for (String s : st.keys()) StdOut.println(s + " " + st.get...
4
public String toString(){ StringBuffer sb = new StringBuffer(); sb.append(this.getClass().getSimpleName()); sb.append("[" + id + "]: "); for(int i = 0; i < arguments.size(); i++){ if(i > 0){ sb.append(", "); } sb.append(arguments.get(i)...
2
public static void start() { isRunning = true; status = Constant.MAIN; window = new MainWindow(); windowThread = new Thread(window); winSize = window.getWinSize(); player = new Player(0, 0); map = new TestMap(); personList = map.getPersonList(); worldList = map.getWorldList(); windowThread.start...
8
@Override public String toString() { return "Move from " + getStart() + " to " + getDestination(); }
0
public <T> T createBean(Class<T> iface) { try { Class<? extends T> impl = (Class<? extends T>) registry.get(iface); BeanInvocationHandler handler = new BeanInvocationHandler(impl.newInstance(), interceptors); T newProxyInstance = (T) Proxy.newProxyInstance( Thread.curren...
3
@Override public void run() { while (Check.keepPinging) { Check.attempts += 1; try { pingSum = (int) (pingSum + Check.ping()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } Check.setMediaPing(pingSum / Check.attempts); if (times > 0 && Chec...
5
Page readPageData(RandomAccessFile raf) throws IOException { PageId pid; Page newPage = null; String pageClassName = raf.readUTF(); String idClassName = raf.readUTF(); try { Class<?> idClass = Class.forName(idClassName); Class<?> pageClass = Class.forNam...
9
private int createInt2CFromBinaryString(String s, int nbBits){ int ret = 0; boolean isNegative = (s.length() == nbBits && s.charAt(0) == '1') ? true : false; for(int i = 32; i > s.length(); i--){ ret <<= 1; ret |= (isNegative) ? 1 : 0; } for(int i = 0; i < s.length(); i++){ ret <<= 1; ret |= (s.ch...
6
public static void main(String[] args) { Scanner in = new Scanner(System.in); char grade = in.next().charAt(0); switch (grade) { case 'A': System.out.println("Excellent"); case 'B': System.out.println("Good"); ca...
5
private Matrix swapLines(Matrix matrix, int row1, int row2) { Matrix result = new Matrix(matrix.getRows(), matrix.getColumns()); for (int x = 0; x < matrix.getRows(); x++) { if (x == row1) { for (int y = 0; y < matrix.getColumns(); y++) { result.setEleme...
8
public void insertMatchRecord() { PreparedStatement st = null; ResultSet rs = null; String q = "INSERT INTO match_record_2013 SET " + "user = ?, team_id = ?, event_id = ?, match_number = ?, color = ?, " + "auton_top = ?, auton_middle = ?, auton_bottom = ?, " + ...
3
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml"); HelloBean helloBean = (HelloBean) context.getBean("helloBean"); log.debug(helloBean.toString()); }
0
private BencNode readUnknownTypeNode() { if (pos >= data.length) { throw unexpectedEnd(); } if (data[pos] == 'i') { return readIntNode(); } else if (data[pos] == 'l') { return readListNode(); } else if (data[pos] == 'd') { return re...
5
public static char five(int r, int c, int f) { if (s1(r, c, f) || s4(r, c, f)) return '|'; else if (s3(r, c, f) || s6(r, c, f) || s7(r, c, f)) return '_'; return '.'; }
5
public ArrayList <Production> getTrace() { myAnswerProductions=new ArrayList <Production>(); myOrderComparator=new OrderCorrectly(); // System.out.println("WHOLE MAP = "+myMap); getMoreProductions(START_VARIABLE, "0,"+(myTargetLength-1)); // System.out.println(myAnswerProductions); return myAnswe...
0
public void run() { try { this.ssck = new ServerSocket(); this.ssck.bind ( new InetSocketAddress ( EzimNetwork.localAddress , EzimNetwork.localDtxPort ) ); this.loop(); } catch(Exception e) { EzimLogger.getInstance().severe(e.getMessage(), e); EzimMain.showError(Ez...
4
*/ public static void setPowerloomFeature(Keyword feature) { if (!(Logic.$CURRENT_POWERLOOM_FEATURES$.memberP(feature))) { if (feature == Logic.KWD_TRACE_SUBGOALS) { Logic.clearCaches(); Stella.addTrace(Cons.cons(Logic.KWD_GOAL_TREE, Stella.NIL)); } else if (feature == Logic.KWD_...
9
public MainMenu() throws IOException { setIconImage(ResourceUtil.getIcon(ResourceUtil.RESOURCE_GAME_ICON) .getImage()); setResizable(false); setBounds(100, 100, 825, DEFAULT_WIDTH); setDefaultCloseOperation(EXIT_ON_CLOSE); player = new Player(); setTitle(APP_NAME + ": " + Player.getNickname() + Playe...
4
@Override public void run() { try { // Ϣ String msgStr = ""; // ַָеλ int separatorIndex = 0; // ǷϢ isListen = true; while(isListen) { // Ϣ ...
9
@Override public ArrayList<Integer> getMove() { Path bestPath = null; Path bestPath1 = null; Path bestPath2 = null; /* * For 2 and 3 player games the AI needs to check 2 colors, those are * assigned here. 4 Player games only let each player have one color. */ if (playerCount == 2) { bestPath1 = g...
5
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final java...
6
private void generateRandomMap() { mapGrid = new Entity[width][height]; setColumnCount(width); setRowCount(height); for (int y = 0; y < 10; y++) { for (int x = 0; x < 10; x++) { int rand = (int) (Math.random() * 100); if (rand < 15) { ...
7
public void load(DataInputStream in, String name, World w) { this.name = name; try { world = w; try { while (true) { int d = in.readInt(); if (d == Material.CHEST.getId()) { blocks.add(new BlocksChest(in, world)); } else if (d == Material.SIGN.getId() || d == Material.SIGN_POST.getId(...
6
private double getCost2(Node parent, String[] ngram, int length) { if(parent.value.equals(EMPTY_PUNCT)) { if(parent.parent!=null) { return getCost2(parent.parent, ngram, length); } else { return 1.0D; } } ngram[length] = parent....
4
public void buildBarracks(Map map, Cell c, Boolean aiMove) { if (aiMove || Teams.comparePlayers(this.getOwner(),game.getCurrentPlayer())) { if (game.getCurrentPlayer().canAfford(Barracks.cost)) { if (getBuildableCells(map).contains(c)) { Barracks b = new Barracks...
5
public void runecraftingComplex(int screen) { if (screen == 1) { clearMenu(); menuLine("1", "Air runes", 556, 0); menuLine("2", "Mind runes", 558, 1); menuLine("5", "Water runes", 555, 2); menuLine("6", "Mist runes", 4695, 3); menuLine("9", "Earth runes", 557, 4); menuLine("10", "Dust runes", 469...
4