text
stringlengths
14
410k
label
int32
0
9
public PhpposPeopleEntity getPeopleEntity(int idPeople){ return (PhpposPeopleEntity) getHibernateTemplate().get(PhpposPeopleEntity.class, idPeople); }
0
public void setNametextZoomedFontcolor(int[] fontcolor) { if ((fontcolor == null) || (fontcolor.length != 4)) { this.nametextZoomedFontColor = UIFontInits.NAMEZOOMED.getColor(); } else { this.nametextZoomedFontColor = fontcolor; } somethingChanged(); }
2
private void geteof() { if(recno>reccount) { recno = reccount+1; if(Idx!=null) Idx.recno = recno; else if(cdx_file) Cdx.recno = recno; } eof = (recno>reccount); }
3
public void sendMessage(Player player) { Long lastTime = lastMessageTimes.get(player); if (lastTime != null && System.currentTimeMillis() - lastTime <= coolDown) return; player.sendMessage(message); lastMessageTimes.put(player, System.currentTimeMillis()); }
2
@Test public void testMakePaymentsWithProfile() { Gateway beanstream = new Gateway("v1", 300200578, "4BaD82D9197b4cc4b70a221911eE9f70", // payments API passcode "D97D3BE1EE964A6193D17A571D9FBC80", // profiles API passcode "4e6Ff318bee64EA391609de89aD4CF5d");//...
1
private void ValidarCampos() throws Exception{ if(jTextField_Codigo.getText().trim().length() == 0){ throw new Exception("Preencha o campo Código"); } if(jTextField_Nome.getText().trim().length() == 0){ throw new Exception("Preencha o campo Nome"); } if(jT...
5
public void setjLabelVille(JLabel jLabelVille) { this.jLabelVille = jLabelVille; }
0
private int jjMoveStringLiteralDfa0_0() { switch(curChar) { case 40: return jjStopAtPos(0, 10); case 41: return jjStopAtPos(0, 11); case 42: return jjStopAtPos(0, 6); case 43: return jjStopAtPos(0, 8); case 45: return jjStopAtPos(0, 9); ...
7
public static String removeFormatting(String line) { int length = line.length(); StringBuffer buffer = new StringBuffer(); for (int i = 0; i < length; i++) { char ch = line.charAt(i); if (ch == '\u000f' || ch == '\u0002' || ch == '\u001f' || ch == '\u0016') { ...
5
public Entradas getEntradasIdEntrada() { return entradasIdEntrada; }
0
@Override public void mouseClicked(MouseEvent e) { if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) { GuiUtils.navigate(uri); } }
1
private boolean initTemplateFile() { String location = OnlineUsers.directory+OnlineUsers.flatfileTemplate; if (!new File(location).exists()) { FileWriter writer = null; try { writer = new FileWriter(location); writer.write("#This is the template file for OnlineUsers\r\n"); writer.write("#Replaceme...
4
public int getNewMarkPosition() { return this.newMarkPosition; }
0
public int put(int key, int n) { int pos, t = 1; while (t < m) { pos = toHash(key, t); if (table[pos] == null) { table[pos] = new HashEntry(key, t); // ???????????????????????????????????????????????????????????????????????????????????? // ...
3
private int getPlayerIDFromUser(String prompt, String[] arrplay) { while(true){ try { String Name = PlayerSelectFrame.choosePlayer(prompt, arrplay); if (Name.equals("NONE")) return 0; return RunFileGame.getPlayerIDFromName(Name); } catch (WrongNameException e) { displayError("FUCK OFF THA...
3
@Override public int getNextPage() { return (hasNextPage()) ? this.currPage+1 : this.pages; }
1
public void evaluateParticles() { for (Particle particle : particles) { // evaluate all particles and update personal fitnesses double fitness = fitnessEvaluation.evaluate(particle); if (fitness > fitnessThreshold) { particle.updatePersonalBestPosition(fitness); particle.updateGlobalBestPosition(p...
9
@Override public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) { sender.sendMessage(ChatColor.RED + "=====[ MonoBoxel v" + master.getDescription().getVersion() + " Info ] ====="); List<String> worldNames = new ArrayList<String>(); for (MultiverseWorld world : mast...
8
public void StartGameServer(String gameName) { if(broadcastServer.running) broadcastServer.stopServer(); broadcastServer.startServer(gameName); }
1
public static void main(String[] args) throws Exception { StaticDynamicUncertaintyWithADIULHSolver solver = new StaticDynamicUncertaintyWithADIULHSolver(); PrintStream filePrintStream = new PrintStream(new File("results/ADI-Cost-Experiment1b.csv")); PrintStream[] printStreams = new PrintStream[2]; printStrea...
1
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
@Override public void action() { block(delay); ACLMessage mensagem = agente.receive(); if(mensagem != null){ System.out.println("Recebi mensagem AP"); // Se o protocolo for FIPA CONSTRACT NET if(mensagem.getProtocol().equals(FIPANames.InteractionProtocol.FIPA_CONTRACT_NET)){ // SE for...
8
public boolean comprar(final Precio precioAMejorar){ //comprobamos que tengamos suficientes puntos int aGastar = puntos - precioAMejorar.getActual(); if(aGastar >= 0){ //incrementar nos devolverá la cantidad total que costó // dicha incrementación int...
5
public synchronized void updateClients () { for (int i = 0 ; i < flexclients.size () ; i++) { TcpThread currThread = (TcpThread) flexclients.get (i); currThread.ID = i; } }
1
@Override public boolean authorize(AuthorizationToken token) { if (token.getType().equals(getType())) { if (userExists(token.getId()) && userAccess.get(token.getId())) { return true; } System.out.println("Access denied."); } else { System.out.println("Invalid AuthorizationToken."); } retur...
3
@Override protected void calculateThumbLocation() { // Call superclass method for lower thumb location. super.calculateThumbLocation(); // Adjust upper value to snap to ticks if necessary. if (slider.getSnapToTicks()) { int upperValue = slider.getValue() + slider...
7
public Field[] getFields(Class parentClass, boolean isDeclared, String... strings) throws NoSuchFieldException { Field[] fields = new Field[strings.length]; for (int len = 0; len < strings.length; ++len) { String string = strings[len]; if (string != null || string != "") { ...
7
private static boolean isUpdateAvailable(URI remoteUri, File localFile) { URLConnection conn; try { conn = remoteUri.toURL().openConnection(); } catch (MalformedURLException ex) { //log.error("An exception occurred", ex); return false; } catch (IOException ex) { //log.error("An exception ...
4
public static Cons mostSpecificRelations(Cons relationrefs, boolean classifyfirstP) { { Cons relations = Stella.NIL; { Stella_Object r = null; Cons iter000 = relationrefs; Cons collect000 = null; for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) { r = iter000.value; ...
9
void put(int key, int value) { int bucket = key % buckets; if(bucket < 0) { bucket = -bucket; } int[] data = content[bucket]; if(data == null) { data = new int[33]; content[bucket] = data; } int off = data[0] * 2 + 1; // eliminate duiplicates if(off == 1 || data[off-2] != key || data[off-1] ...
6
@Override public void windowClosing(WindowEvent e) { //throw new UnsupportedOperationException("Not supported yet."); if ((this.currentState == State.INITIAL) || (this.currentState == State.PREPARED) || (this.currentState == State.PROCESSED)) { if (JOption...
4
public void update() throws MaltChainedException { // Retrieve the address value final AddressValue arg1 = addressFunction1.getAddressValue(); final AddressValue arg2 = addressFunction2.getAddressValue(); try { if (arg1.getAddress() == null || arg2.getAddress() == null) { featureValue.setIndexCode(tabl...
9
public static Map<String, Object> generateSchema(DateType anno) { // Make sure annotation is valid if (anno == null) { return null; } Map<String, Object> map = new HashMap<String, Object>(); map.put(Field.TYPE.getName(), Type.DATE.getName()); if (! anno.index_name().isEm...
9
public Dimension getUnit() { return this.unit; }
0
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(buf); return result; }
0
private Component cycle(Component currentComponent, int delta) { int index = -1; loop : for (int i = 0; i < m_Components.length; i++) { Component component = m_Components[i]; for (Component c = currentComponent; c != null; c = c.getParent()) { if (component == c) { index = i; break loop; } ...
8
protected Instance mergeInstances(Instance source, Instance dest) { Instances outputFormat = outputFormatPeek(); double[] vals = new double[outputFormat.numAttributes()]; for(int i = 0; i < vals.length; i++) { if ((i != outputFormat.classIndex()) && (m_SelectedCols.isInRange(i))) { if ((sourc...
7
public void onEnable() { config = new Config(this); debug = config.getDebug(); if (!setupSQL()) { sendErr("SQL could not be setup, EndersGame will disable"); getPluginLoader().disablePlugin(this); return; } int a = 0; int l = 0; send("Setting up arenas and lobbies"); try { ResultSet ls = ...
4
public static List mostSpecificTypes(List types) { if (types.rest() == null) { return (types); } { Cons cursor1 = types.theConsList; Cons cursor2 = null; Stella_Object value1 = null; Stella_Object value2 = null; while (!(cursor1 == Stella.NIL)) { value1 = ((Surrogate)(...
7
@Override public int indeksTil(T verdi) { int indeks =-1; Node<T> sjekk = hode; if(verdi==null){ indeks=-1; } else if(sjekk==null){ indeks=-1; } else{ for(int i=0;i<antall;i++){ if(verdi.equals(sjekk.verdi)){...
4
private void close() { int result = JOptionPane.showConfirmDialog( this, "Are you sure you want to exit the application?", "Exit Application", JOptionPane.YES_NO_OPTION); if(result == JOptionPane.YES_OPTION) { if(getContentPane() == waitPanel ...
3
public SolutionType[] decodeSolution(String str) throws DecodeException { SolutionType[] res; int i=0; int beginning = i; while (str.charAt(i) != '>') { i++; } String type = str.substring(beginning, i); i++; beginning = i; if (...
8
public void registerListener(String itemName, Integer strategy) throws RemoteException, IOException { ser.registerListener(AuctionClient.authCode, this, itemName); if(strategy == 1){ String bidderName = new String(); BufferedReader in = new BufferedReader(new InputStreamReader(Sy...
8
public static String unhtmlentities(String str) { //initialize html translation maps table the first time is called if (htmlentities_map.isEmpty()) { initializeEntitiesTables(); } StringBuffer buf =...
9
public float medium(float x) { if (x <= a) return 0; else if (x > a && x <= b) return (float) (1f / (b - a)) * x - ((float) a / (b - a)); else if (x > b && x <= c) return 1; else if (x > c && x <= d) return (float) (1f / (c - d)) * x + ((float) d / (d - c)); else return 0; }
7
public boolean readBoolean(String pSection, String pKey, boolean pDefault) { //if the ini file was never loaded from memory, return the default if (buffer == null) {return pDefault;} Parameters params = new Parameters(); //get the value associated with pSection and PKey String valueText = getValu...
4
public void visit_d2i(final Instruction inst) { stackHeight -= 2; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 1; }
1
private ImageIcon getImageFromValue(Value value, Relay.Direction direction) { //this logic taken from WPILib switch(value) { case kOff: return relayForwardNoReverseNo; case kOn: return relayForwardYesReverseYes; case kForward: ...
6
public void register(Class<? extends Command> c) { CommandInfo info = c.getAnnotation(CommandInfo.class); if (info == null) return; try { commands.put(info.pattern(), c.newInstance()); } catch (Exception e) { e.printStackTrace(); } }
3
@Override public double calculate(double[] phenome) { double score = 0; double[] me = new double[phenome.length]; double[] you = new double[phenome.length]; for(Individual<?,double[]> individual : population){ System.arraycopy(phenome,0,me,0,me.length); System.arraycopy(individual.getPhenome(),0,you,0,me...
9
public void setShareKey(String shareKey) { this.shareKey = shareKey; }
0
public void setBlock(int x, int y, Block newBlock) { blockSheet[x][y] = newBlock.getBlockID(); }
0
private void configureErrorDocuments() { // Find default ERROR_DOCUMENT settings for( int statusCode = 300; statusCode < 599; statusCode++ ) { // Build key. String ckey = Constants.CKEY_HTTPCONFIG_ERROR_DOCUMENT_BASE.replaceAll( "\\{STATUS_CODE\\}", Integer.toString(statusCode) ); // ...
4
public void run() { ParserGetter kit = new ParserGetter(); HTMLEditorKit.Parser parser = kit.getParser(); while (mon.getNbrTraversed() < 2000) { try { String href = mon.getNext(); URL url = null; if (href.startsWith("mailto")) { s.add(href, true); continue; } else if (href.startsWith...
4
public void setExp(PExp node) { if(this._exp_ != null) { this._exp_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } ...
3
public static void main(String[] args) { int i; float inputs06[] = { 20, 22, 21, 24, 24, 23, 25, 26, 20, 24, 26, 26, 25, 27, 28, 27, 29, 27, 25, 24 }; float inputs10[] = { 20, 22, 24, 25, 23, 26, 28, 26, 29, 27...
2
public void AssignmentSymbolInImageSpace(String symbol){ //功能: //找到激活强度最高的节点,对这个节点的Symbol属性进行赋值 //先找high int high; int imagespacesize=imagespace.size(); high=imagespace.get(0).ActivatedLevel; for(int i=0;i<imagespacesize;i++){ if(imagespace.get(i).ActivatedLevel>high){ high=imagespace.get(i).Act...
5
public static void main(String[] args) { while (true) { System.out.print("Enter an id: "); Scanner scanner = new Scanner(System.in); int accountId = scanner.nextInt(); Account account1 = new Account(accountId); if (!account1.isAccountIdValid(accountId)) { System.out.println("The account Id you ente...
7
private boolean requirementsMetRemove(){ List<Enhancement> el = DDOCharacter.getTree(prestige).getEnhancementList(); int treePointsSpent = DDOCharacter.getTree(prestige).getPointsSpent(); int modTreeSpent = treePointsSpent; for(Enhancement e : el){ if(e.requireAllOf.contains(this.id) && e.tiersTaken >= th...
7
private int[][] generateSolution(int[][] game, int index) { if (index > 80) return game; int x = index % 9; int y = index / 9; List<Integer> numbers = new ArrayList<Integer>(); for (int i = 1; i <= 9; i++) numbers.add(i); Collections.shuffle(numbers); ...
5
public void save() { XStream s = new XStream(); FileOutputStream out; try { out = new FileOutputStream(new File("Player.xml")); s.toXML(this, out); out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
2
public boolean removeRoom(String name){ if (name.equalsIgnoreCase("main")) return false; ChatServerChatRoom room = chatRooms.remove(name.toLowerCase()); if (room==null) return false; room.close(); //room.dealloc //oh wait no, we can't do that System.out.println("Room kill...
2
public boolean isLegalMoveOne(int pieceNumber){ if (board.getBoard()[pieceNumber].getPieceType()==1 || board.getBoard()[pieceNumber].getPieceType()==2){ if (board.getBoard()[pieceNumber].getX()==0) return false; } else{ if (board.getBoard()[pieceNumber].getY()==0) return false; } int p...
8
private void relax(Vortex closestVortex, int pathId, int neighborId) { double dayTravelLength = oergi.getTravelLength(); Corridor corridor = corridors.getCorridor(pathId); if (!corridor.gainPassage(oergi)) { return; } //oergi will make sure that travel length might be infinite double corridorTravel...
3
public static void init() throws IOException { gui = new ArrayList<int[]>(); pro = new ArrayList<Thread>(); Twindow = new JFrame(); Twindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); Twindow.setSize(500, 500); Twindow.setTitle("NXT-Projekt - Feld Anzeige - Marcel Link"); info = new JFrame(); info....
3
private boolean isFallFromTable(Direction d, Position p) { boolean result = true; switch (d) { case EAST: if (p.getCoordinateX() + 1 < table.getLengthX()) { result = false; } break; case SOUTH: if (p.getCoordinateY() - 1 >= 0) { result = false; } break; case WEST: if (p.getCoordin...
8
public static Cons simplifyAntecedent(Cons antecedent, Cons outputVariables, List positive, List negative) { { Cons newAntecedent = Stella.NIL; Cons candidate = Stella.NIL; Cons discardedPotentialGenerators = Stella.NIL; int coveredExamples = 0; int previousCoveredExamples = 0; int sco...
6
public static void main (String args[]) throws Exception{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer line = new StringTokenizer(reader.readLine()); int n = Integer.parseInt(line.nextToken()); int m = Integer.parseInt(line.nextToken()); IntArray intArray = n...
4
public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) { if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; if (tool.type == ToolType.shovel) { if (player.payStamina(4 - tool.level)) { level.setTile(xt, yt, Tile.hole, 0); level.add(new ItemEntit...
5
public static final boolean check(final File f) { if (!f.isDirectory()) { return false; } final String[] list = f.list(); if (list == null) { return false; } for (final String s : list) { if (s.startsWith("drum") && s.endsWith(".drummap.txt")) { for (int i = 4; i < (s.length() - 12); i++) { ...
8
private String checkName(String s) { if (s.compareTo("") == 0) return ""; if (s.length() > 15) return "Name is too long"; for (int i = 0; i < s.length(); i++) { if (!checkChar(s.charAt(i))) return "Only letters or numbers"; } return null; }
4
public void setNombre(String nombre) { this.nombre = nombre; }
0
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String string = Double.toString(d); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 ...
7
public int getHeight(){ return height; }
0
@Test(groups = {"create"}) @Parameters({"browser"}) @BeforeClass public void beforeClass(String browser) throws IOException, InterruptedException { if (browser.equals("firefox")) { driver=browserFirefox(); } else if (browser.equals("chrome")) { driver=browserChrome();...
9
public void cleanup() { try{ if(select != null) select.close(); if(insert != null) insert.close(); if(delete != null) delete.close(); if(update != null) update.close(); if(getMaxKey != null) getMaxKey.close(); } catch (Exception e) { e.printStackTrace(); } }
6
public int getSuppliercode() { return this.suppliercode; }
0
@Override public List<PastMeeting> getPastMeetingList(Contact contact) { if (!allContacts.contains(contact)) { throw new IllegalArgumentException("Contact does not exist"); } List<PastMeeting> pastMeetingsPerContact = new ArrayList<PastMeeting>(); //all meetings for a con...
6
public KeyControl(Canvas3D canvas3D) { KeyListener l = new KeyListener() { @Override public void keyTyped(KeyEvent e) { // Ignore } @Override public void keyReleased(KeyEvent e) { // Ignore } @Override public void keyPressed(KeyEvent e) { char key = e.getKeyChar(); ...
8
private boolean mayOverwrite(File file) { if (overwriteMode == Controller.OVERWRITE_ALL_NO) { return false; } if (overwriteMode == Controller.OVERWRITE_ALL_YES) { return true; } overwriteMode = Application.getController().shallOverwriteFile(file); ...
4
public static void main(String[] args) { In in = new In(args[0]); while (true) { int V = in.readInt(); if (V == 0) break; int E = in.readInt(); Digraph G = new Digraph(V); for (int i = 0; i < E; i++) { int v = in.readInt(); int w = in.readInt(); G.addEdge(v, w); } int[] co...
9
private final void method1747(byte byte0, int i, Stream stream) { if (byte0 >= -8) { method1750(-4); } if (i != 1) { if (i != 2) { if (i == 3) { int j = stream.readUByte(); anIntArray4683 = new int[j]; ...
8
@Override public Set<Map.Entry<String, Object>> entrySet() { return new AbstractSet<Map.Entry<String, Object>>() { @Override public Iterator<Map.Entry<String, Object>> iterator() { return new Iterator<Map.Entry<String, Object>>() { ...
9
private double countColumnsBetween(int beginning, int end) { double columns = 0.0; for (RoadGeometry roadGeometry : geometry) { if (road.intervalContainsGeometry(roadGeometry, beginning, end)) { columns = addColumnsFromGeometry(roadGeometry, beginning, end, columns); } } return columns; }
2
@Override public Object getValueAt(int rowIndex, int columnIndex) { switch (columnIndex) { case 0: return filesList.get(rowIndex).getFileName(); case 1: return filesList.get(rowIndex).getLastModificationDate(); case 2: return ...
5
public final void setTopic(String channel, String topic) { this.sendRawLine("TOPIC " + channel + " :" + topic); }
0
@Override protected void map(Object key, Text value, Context context) throws IOException, InterruptedException { String ref = value.toString().substring(1); String page = downloadPage(new Path(root + ref), context); List<String> refList = new LinkedList<String>(); Matcher matcher ...
4
public void recordGameSettings(){ BattleMap bm = map; String a = "BattleMap\n"; a = a.concat(bm.getNumRows() + "," + bm.getNumCols() + "\n"); a=a.concat("Bases\n"); for(Base b : map.getBases()){ a = a.concat("player " + b.getOwnerId() + ": " + b.getLocation().getRow() + "," + b.getLocation().getCol() + ...
9
public boolean isSymmetric(TreeNode root) { if(root == null) return true; TreeNode p = root.left; TreeNode q = root.right; if (p == null) return q == null; if (q == null) return p == null; TreeIterator ip = new TreeIt...
8
public void keyPressed(KeyEvent e) { int offset = (e.getKeyCode() == KeyEvent.VK_UP) ? (-7) : ((e.getKeyCode() == KeyEvent.VK_DOWN) ? (+7) : ((e.getKeyCode() == KeyEvent.VK_LEFT) ? (-1) ...
6
private Value determineValue(final Token token) throws AssemblerSyntaxException { Value value; switch (token.getType()) { case INTEGER: value = Value.valueOf(parseToByte(token)); break; case FLOAT: value = Value.valueOf(parseToFloat...
7
final void ia(short i, short i_626_) { for (int i_627_ = 0; i_627_ < anInt5351; i_627_++) { if (aShortArray5311[i_627_] == i) aShortArray5311[i_627_] = i_626_; } if (aClass6Array5361 != null) { for (int i_628_ = 0; i_628_ < amountPolygons; i_628_++) { Class6 class6 = aClass6Array5361[i_628_]; Class35...
5
public static void main(String[] args) { Scanner scn = new Scanner(System.in); int t = Integer.valueOf(scn.nextLine()); for (int tc = 1; tc <= t; tc++) { String line = scn.nextLine(); StringTokenizer st = new StringTokenizer(line); // Combinations ...
9
private void humanAction(HumanCharacter theHumanCharacter,Monster theMonster){ System.out.println("What would you like to do?"); System.out.println("Type 'melee' to use melee attack"); System.out.println("Type 'magic' to use magic attack"); System.out.println("Type 'potion' to use a health, or mana potion."); ...
8
private static void exportWay(final Way way, final BufferedWriter writer, final boolean force) throws IOException { if (!way.isModified() && !force){ return; } for (Node node : way.getNodes()){ exportNode(node, writer,true); } final StringBuilder stringWay...
9
public static void main(String[] args) { int m1,n1,m2,n2; char again; do{ print("Enter the dimensions of the first matrix: "); n1 = scan.nextInt(); m1 = scan.nextInt(); print("Enter the dimensions of the second matrix: "); n2 = scan.nextInt(); m2 = scan.nextInt(); if(m1 == n2){ dou...
3
protected static Element getModelElement(Document doc, ModelType modelType) throws Exception { NodeList temp = null; Element model = null; switch (modelType) { case REGRESSION_MODEL: temp = doc.getElementsByTagName("RegressionModel"); break; case GENERAL_REGRESSION_MODEL: temp...
8
public static void main(String[] args)throws IOException { double finalAnswer=0; double finalR2=0; double finalPeriod=0; double finalPercDif=0; for(int i = 2;i<=2;i++){ for(int j=6;j<=6;j++){ for(int k=3;k<=3;k++){ doub...
4
public void moveOneFrame() { for (int i = 0; i < speed; i++) { if (direction == NORTH) { move(0, -1); } else if (direction == EAST) { move(1, 0); } else if (direction == SOUTH) { move(0, 1); } else if (direction == WEST) { move(-1, 0); } if (tank.BulletExists()) { bulletControl()...
6
protected static void tryOrdinaryActions(Unit unit) { // ========================================================= // Act according to STRATEGY, attack strategic targets, // define proper place for a unit. UnitType unitType = unit.getType(); // GLOBAL ATTACK is active if (StrategyManager.isGlobalAttackAc...
6