text
stringlengths
14
410k
label
int32
0
9
public static void main(String[] args) throws IOException { Menu menuElement; boolean gameOver = false; System.out.println(START_MESSAGE); System.out.println(); while (!gameOver) { Field gameField = null; do { menuElement = Menu.selectFromM...
7
private automata.fsa.FiniteStateAutomaton readFA(BufferedReader reader) throws IOException { automata.fsa.FiniteStateAutomaton fa = new automata.fsa.FiniteStateAutomaton(); // Generic states. State[] states = readStateCreate(fa, reader); String[][][] groups = readTransitionGroups(2, 1, states.length, reader)...
3
public Generation getNextGeneration(Generation currentGeneration){ if(currentGeneration == null) return null; Generation nextGeneration = new Generation(currentGeneration.getM(), currentGeneration.getN()); //Iterate over each row in currentGeneration for(int i=0; i < currentGeneration.getM(); i++){ ...
7
public void process(File cFile) { boolean modified = false; try { String cName = ClassNameFinder.thisClass(BinaryFile.read(cFile)); if (!cName.contains(".")) return; // Ignore unpackaged classes ClassPool cPool = ClassPool.getDefault(); CtClass ctClass = cPool.get(cName); for (CtMethod method : c...
8
public Screen() { long origTime = System.nanoTime(); System.out.println("--------------------------------------------------------------------------------"); System.out.println("Time start at " + (float) Math.round((System.nanoTime() - origTime) / 1000000) / 1000 + " seconds"); // setting size this.se...
7
private String convertStateToString(int state) { if (state == JFrame.NORMAL) { return "NORMAL"; } String strState = " "; if ((state & JFrame.ICONIFIED) != 0) { strState += "ICONIFIED"; } //MAXIMIZED_BOTH is a concatenation of two bits, so ...
6
public static EntityManager getEntityManager() { if (JPAUtil.factory == null) { JPAUtil.factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); } EntityManager m = JPAUtil.manager.get(); if (m == null) { m = JPAUtil.factory.createEntityManager(); ...
2
@Override public void addCandidate(Route route) { if (routes.size() == 0 || route.getLength().lessThan(currentShortestLength())) { routes.clear(); routes.add(route); } }
2
public String getGame() { return game; }
0
public void load() { Spell spell = Spell.loadSpell(ID + ""); nameText.setText(spell.getName()); spellTypeCombo.setSelectedItem(spell.getSpellType()); costSpinner.setValue(spell.getCost()); toggleType(); switch(spellTypeCombo.getSelectedIndex()) { case(0): speedSpinner.setValue(spell.getSpeed()); ...
4
@Override public void assignOrder(Orders order, Ship target) { if(_location.isConflicted()) { JOptionPane.showMessageDialog(_location, "Planet is in a conflicted zone! Can not perform orders!"); } if(order == Orders.UPGRADE) { if(target.getLoc() == _location) { if(target.setUpgrading(true)) { clea...
5
public final static Map<Integer, Path> readExternals(final InputStream in) throws IOException { final Map<Integer, Path> map = new HashMap<>(); if (in != null) { while (true) { final IntegerPointer available = new IntegerPointer( in.available()); if (available.isZero()) { break; } w...
6
public start() { super("Overcast Network XML generator"); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{1, 386, 0, 0}; gridBagLayout.rowHeights = new int[]{14, 0, 23, 0, 0, 0, 0, 0}; gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE}; grid...
9
public void actionPerformed(ActionEvent e) { if (e.getSource() == this) this.setFocusable(true); else if (e.getSource() == btnNameInput) { GameFile.strPlayerName = inputName.getText(); inputName.setVisible(false); btnNameInput.setVisible(false); screenCount += 1; repaint(); this.setFocusable(tr...
5
private void startAction(int i) { if (i == 1) { if (saveFileExists) { Gdx.app.log(ChromeGame.LOG, "Run Game From Save File"); } else { Gdx.app.log(ChromeGame.LOG, "Create a New Game"); game.setScreen(new NGIntro(game)); } } else if (i == 2) { if (saveFileExists) { Gdx.app.log(ChromeGame....
5
@Test public void transferInstrLOAD_testInvalidRegisterRef() { //Checks LOAD instruction not created with invalid register ref. try { instr = new TransferInstr(Opcode.LOAD, 50, 70); } catch (IllegalStateException e) { System.out.println(e.getMessage()); } assertNull(instr); }
1
public CuboidDirection opposite() { switch (this) { case North: return South; case East: return West; case South: return North; ...
9
static private DOMNode buildEntrySignature(Entry entry) { String name = entry.getName(); Annotation annotationType = entry.getAnnotationType(); boolean isStatic = annotationType == Annotation.STATICMETHOD || annotationType == Annotation.STATICPROPERTY ? true...
9
public Position huff(){ IteratorOnPieces iterator = (IteratorOnPieces) player.iterator(); while (iterator.hasNext()){ iterator.next(); Position position = iterator.getPosition(); if(player.getBoard().getPiece(position).getHuff()) { player.getBoard().eliminate(position); return position; } } ...
2
public List<Token> getBestTokens(Sentence sentence) throws IOException { SentenceIterator iterator = sentence.iterator(); int length = iterator.length(); char[] surface = sentence.getCharacters(); // Initialize the Viterbi lattice this.bosNode = this.tokenizer.getBOSNode(); this.eosNode = this.tokenizer.g...
8
public static String[] searchCustomer(Integer ID) { Database db = dbconnect(); String [] Array = null; try { String query = ("SELECT * FROM customer WHERE CID = ? AND bDeleted = 0"); db.prepare(query); db.bind_param(1, ID.toString()); ResultSet rs ...
2
public boolean exists(String path){ URL imgurl = getClass().getResource(path); if(imgurl!=null){ try { ImageIO.read(imgurl); } catch (IOException ex) { return false; } return true; }else{ System.err.print...
2
protected NetQuery(String serviceURL, String query, byte queryType, String defaultGraph, int timeout) { String urlString = null; try { queryString = query; char delim=serviceURL.indexOf('?')==-1?'?':'&'; if(queryType==Query.UPDATE_TYPE) urlString = serviceURL; else { urlString = serviceURL + del...
6
synchronized public void setShortestHistory(List<Integer> shortestHistory) { if (this.shortestHistory.size() == 0 || shortestHistory.size() < this.shortestHistory.size()) { this.shortestHistory = shortestHistory; } }
2
private void fireAt(ScannedRobotEvent event) { if (event.getName().equals(Observer.TARGET)) { if (NearestNeighborSelector.disabledBotExists()) { this.bulletPower = Rules.MIN_BULLET_POWER; // set bullet power to min, and snipe disabled robot } else if (event.getDistance()...
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ProtocolElem other = (ProtocolElem) obj; return Objects.equals(this.id, other.id); }
2
protected static StringBuilder removeNewLineSignFromEnd(StringBuilder text) { if (text.charAt(text.length() - 1) == '\n') { return new StringBuilder(text.substring(0, text.length() - 1)); } else { return text; } }
1
public void insert() throws ESellException { //Prfen, ob Email schon vorhanden ist if(!isUserFree(this.email, this.username)){ throw new ESellException(ESellException.ErrorCode.USR_EXISTS); } makeConnection(); PreparedStatement preparedStatement = null; ResultSet res = null; if(co...
4
private void callAction(UserAction userAction) { switch (userAction) { case ADD_NEW_OWNER: callAddNewOwnerAction(); break; case ADD_NEW_CAR: view.printNoSupport(); break; case GET_OWNER_BY_ID: view.printNoSupport(); break; case GET_CAR_BY_ID: view.printNoSupport()...
5
private static Operation interpretNextCommand(Scanner scanner) throws FactoryException { String command = scanner.next(); if (command.equals("print")) { System.out.println(image.toString()); } else if (command.equals("printsaved")) { if (saved.size() == 0) ...
7
@Override public Double get(int i) { switch (i) { case 0: return w; case 1: return x; case 2: return y; case 3: return z; default: throw new IndexOutOfBoundsException(); } }
4
public void shoot() { // kornyezo mezook elkerese List<Field> fieldList = new ArrayList<Field>(); fieldList = field.getNearByRoads(range); shootableCharacters.clear(); // visitable objektumok vegigjarasa for (Field f : fieldList) { for (Visitable v : f.getVisi...
5
public void mouseClicked(int mouseX, int mouseY) { //Send mouseClick to each object. //NOTE: for-each caused concurrentModificationException //because it was adding items to screenObjects //at some point for (int i = 0; i < screenObjects.size(); i++) { ImageButton obj = screenObjects.get(i); obj.mous...
3
private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed //Se cierra la interfaz de abrir setVisible(false); }//GEN-LAST:event_btnCerrarActionPerformed
0
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
private IStatus doRedo(IProgressMonitor monitor, IAdaptable info, IUndoableOperation operation) throws ExecutionException { IStatus status = getRedoApproval(operation, info); if (status.isOK()) { notifyAboutToRedo(operation); try { status = operation.redo(monitor, info); } catch (OperationCanceledE...
9
public String getName() { return name; }
0
public void eatFuel() { AbstractMachine.this.fuelLevel -= coef; // fuelLevel -= coef; }
0
public int estimateTimeOut(int[] from, int[] to, int[] len) { Integer l = from.length; int[] tmp = new int[l]; for (int i = 0; i < l; ++i) { tmp[i] = to[i]; } Arrays.sort(tmp); int idx; for (int i = 0; i < l; ++i) { idx = Arrays.binarySe...
8
private String nextSiteId() { // TODO: replace this linear search with binary search double r = random.nextDouble(); for (Map.Entry<String, Double> entry : siteWeights.entrySet()) { if (r < entry.getValue()) { return entry.getKey(); } } // Unreachable if siteWeights is created co...
2
@Override public void init(ServletConfig config) throws ServletException { super.init(config); String applicationPath = getServletContext().getRealPath("/WEB-INF/classes"); String fileName = config.getInitParameter(CONFIG_FILE_PARAMETER); databaseProperties = new Properties(); ...
9
@Override public String toString() { return "isInterface()"; }
0
public void Tick() { //testDialog.sendMessage("TickMessage!"); Object o = testDialog.pollMessage(); if(o != null) System.out.println(o); // ====== PROCESS NETWORK MESSAGES ====== while(networkMessages.size() > 0) { // No need to check whether message retrievel was successful, // due to the fact th...
7
public static void printerTest() { DocFlavor myFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE; PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); PrintService[] printers = PrintServiceLookup.lookupPrintServices(myFormat, aset); for (PrintService printService : printers...
3
public int pop() { if (index == 0) { // error, the stack is empty return Integer.MAX_VALUE; } int value = array[index - 1]; index--; return value; }
3
public static void main(String[] args) { int matriceA[][] = {{ 1, 2, 3, 4, 5}, { 6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}}; int matriceX[] = new int[matriceA.length]; int matriceY[] = new int[matriceA[0].length]; int i; ...
9
public void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals(NAMESPACES)) { checkNotParsing("feature", name); namespaces = value; if (!namespaces && !prefixes) { prefixes = true; } } else if (name.equals(NAMESPACE_PREFIXES)...
7
public void checkAdd(){ ArrayList newCode = new ArrayList<String>(); String aux1 = ""; String aux2 = ""; boolean inRange, entro; int sum = 0; int n = 0; for (int i=0; i<code.size(); i++) { entro = false; aux1 = code.get(i); inRange = (i+8)<code.size(); if(inRange) { if(code.get(i).indexOf("li...
9
public double getyCoordinate() { return yCoordinate; }
0
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { EntityManager entityManager = null; try { entityManager = factory.createEntityManager(); EloPersistence persistence = new EloPersistence(); persistence.setEntityManager(entityMan...
6
protected boolean appliesToPressed(KeyEvent e) { // only match special characters if the modifiers are consistent if (!characterDef) { if (!((ctrlDown && e.isControlDown()) || !ctrlDown)) return false; if (!((altDown && e.isAltDown()) || !altDown)) return false; } return ((!characterDef) && (this...
8
@Override public void mouseWheelMoved(MouseWheelEvent e) { unprocessedEvents.add(e); mouse = e.getPoint(); }
0
public RegularExpression getExpression() { return expression; }
0
@Override public int matches( char[] sequenceA, int indexA, char[] sequenceB, int indexB, int count ) { for (int i = 0; i < count; i++) { if (sequenceA[indexA + i] != sequenceB[indexB + i]) { return i; } } return count; }
2
final private Expression evaluatePostfix() throws InvalidInputException { Stack<Expression> expressionStack = new Stack<Expression>(); while (this.m_outputQueue.hasNext()) { Token nextToken = this.m_outputQueue.pop(); if (nextToken instanceof Number) { expressionStack.push((Number) nextToken); } ...
7
@Test public void getPlacesBookedTest() { try { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); DiningHall d1 = new DiningHall(24, BigDecimal.valueOf(4.00), DiningHall.Type.MADRUGADORES); DiningHall d2 = new DiningHall(24, BigDecimal.valueOf(4.00), DiningHall.Type.MADRUGADORES); Cal...
1
public void setTerminal(String terminal) { myTerminal = terminal; }
0
private void atPlusPlus(int token, ASTree oprand, Expr expr) throws CompileError { boolean isPost = oprand == null; // ++i or i++? if (isPost) oprand = expr.oprand2(); if (oprand instanceof Variable) { Declarator d = ((Variable)oprand).getDeclarator();...
8
public void updateCognitiveVelocity() { for(int i = 0; i < velocities.length / 2; i++){ for(int k = 0; k < velocities[i].length; k++){ double normDevDist = calculateNormalisedDeviationDistance(k, positions[i][k], personalBest[i]); velocities[i][k] = weight * velocities[i][k] + normDevDist; } } }
2
public ArrayList<Point> pathFrom(int r, int c) { path.add(new Point(r,c)); int row = r, col = c; if(fP.hasExitAt(r, c)) return path; int bestDist = distances[r][c]; if(isValid(r - 1,c) && distances[r -1][c] < bestDist){ row = r -1; col = c; } if(isValid(r + 1,c) && distances[r + 1][c] < bestD...
9
public CommandHandler(TotalPermissions p) { plugin = p; SubCommand[] cmds = new SubCommand[]{ new HelpCommand(plugin), new DebugCommand(plugin), new UserCommand(plugin), new GroupCommand(plugin), new SpecialCommand(plugin), new Wor...
1
public static MaplePacket getScrollEffect(int chr, ScrollResult scrollSuccess, boolean legendarySpirit) { MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendPacketOpcode.SHOW_SCROLL_EFFECT); mplew.writeInt(chr); switch (scrollSuccess) { ...
6
public Iterable<String> keys() { Queue<String> queue = new Queue<String>(); collect(root, new StringBuilder(), queue); return queue; }
0
@Override public void onNotice(String target, IRCUserInfo user, String msg) { if(target.equals("#" + channelName)) if(user.equals(main.getNick())) chatLog.append("\nNotice:" + msg.replaceFirst(main.getNick(), "You")); else chatLog.append("\nNotice:" + msg); }
2
@Override public void run() { long then = System.currentTimeMillis(); while(isRunning) { try { sleep(20); } catch (InterruptedException e) {} long now = System.currentTimeMillis(); level.update((int) (now - then)); then = now; } }
2
@EventHandler(priority = EventPriority.NORMAL) public void onBlockPlace(BlockPlaceEvent event) { if (event.getPlayer() != null) { if (!event.getPlayer().isOp()) { event.setCancelled(true); } } }
2
@GET @Path("/sent/{macAdr}") @Produces({"application/xml", "application/json"}) public List<History> sent(@PathParam("macAdr") String macAdr) { query = em.createNamedQuery("UserMaster.findByMacAdr").setParameter("macAdr", macAdr); if(!query.getResultList().isEmpty()){ um = (UserM...
5
public static boolean hasPAT(String str){ boolean hasPp = false, hasAa = false, hasTt = false, hasPAT = false; char[] chars = str.toCharArray(); for (int i =0; i < chars.length; i++){ if (chars[i] == 'P' ){ hasPp = true; }else if(chars[i] == 'A' ){ ...
9
private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed if (dadosValidos()) { if (senhasValidas()) { try { salvar(); } catch (ValidacaoException ex) { _unitOfWork.rollbac...
3
@Override public void actionPerformed(ActionEvent e) { //Set ip address if (e.getSource() == ipSetButton) { ipAddress = ipField.getText().trim(); local.println("IP Address set to: " + ipAddress); log.setCaretPosition(log.getDocument().getLength()); } // Handle appleButton action. if (e.getSource() =...
9
public void limpiarTablaBuscar(){ try { DefaultTableModel modelo=(DefaultTableModel) tablaBuscar.getModel(); int filas=tablaBuscar.getRowCount(); for (int i = 0;filas>i; i++) { modelo.removeRow(0); } } catch (Exception e) { JOpt...
2
public boolean registrosi(String fecha,String IP) { ResultSet res; try { res = st.executeQuery("select IP,Fecha from registro"); while(res.next()) { System.out.println(IP); System.out.println(String.valueOf(res.getObj...
4
public void checkCollision() { if (rec.intersects(MainClass.rachel.recParent) || rec.intersects(MainClass.rachel.recChild0) || rec.intersects(MainClass.rachel.recChild1)) { visible = false; if (MainClass.rachel.getCurrentHealth() > 0) { MainClass.setScore(MainClass.getScore() + 1); MainClass.rac...
9
public Container createContentPane() { tree = new JTree(new FileSystemModel(new File("."))); MouseListener mouseListener = new MouseAdapter() { public void mousePressed(MouseEvent e) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); tree.getPathFor...
3
private static int findMin(boolean useX, ArrayList<Point> convexHull) { int min = Integer.MAX_VALUE; int index = -1; for (int i = 0; i < convexHull.size(); i++) { int val = useX ? convexHull.get(i).x : convexHull.get(i).y; if (min > val) { min = val; index = i; } } return index; }
3
@Test public void testGetExitKey() { for (Direction dir : Direction.values()){ try { testTile.getExitKey(dir); fail("IllegalArgumentException was expected"); } catch (IllegalArgumentException e){ //this exception was expected } } }
2
private void updateJailOption() { switch(model.getJailOptionState()) { case JAILBREAK: jailOptionText = "Gefaengnisausbruch"; jailOption.setEnabled(true); break; case PAYFINE: jailOptionText = "Frei kaufen"; jailOption.setEnabled(true); break; case DEACTIVATED: jailOptionText ="Ni...
3
public void subTropas(int desp,int i,ArrayList<Guerrero> arr){ if(this.espacioGuerreros+1<16+this.nivel*5){ if((Integer)this.tropas.get(desp)-1>=0){ this.oro+=arr.get(i).costo; this.tropas.set(desp,(Integer)this.tropas.get(desp)-1); this.espacioGuerreros++; } ...
2
public void run(){ try{ ServerType serverType = server.getServerType(); responseOptions = serverType.process(server, instruction, requestOptions); if(ActionResult.isSuccessResult(responseOptions)) result = Progress.Result.SUCCESS; else if(ActionResult.isFailureResult(responseOptions)) ...
5
private boolean implementsConfigurationSerializable(Class<?> clazz) { System.out.println("implementsSerializable()"); for(int i = 0; i < clazz.getInterfaces().length; i++) { System.out.println(clazz.getInterfaces()[i].getName().toString()); if(clazz.getInterfaces()[i...
3
void heapify( heap q, double[] HeapArray, int i, int n ) { boolean moreswap = true; do { int left = 2 * i; int right = 2* i + 1; int smallest; if ((left <= n) && (HeapArray[p[left]] < HeapArray[p[i]])) smallest = left; else smallest = i; if ((right <= n) && (HeapArray[p[right]] < HeapA...
6
public Tache getChallengingTask(Tache[] tasks, int time) { //On récupère la tâche la plus prioritaire qui "peut se réveiller" int size = tasks.length; int flag = 0; Tache challengingTask = null; while(challengingTask == null && flag < size) { if ((tasks[flag].getDernierReveil() <= time) && (tasks[flag]....
4
public void tick() { tickCount++; if (!hasFocus()) { input.releaseAll(); } else { if (!player.removed && !hasWon) gameTime++; input.tick(); if (menu != null) { menu.tick(); } else { if (player.removed) { playerDeadTime++; if (playerDeadTime > 60) { setMenu(new DeadMenu()); ...
9
public TotalPermissions() { super(); boolean found = false; Method[] methods = OfflinePlayer.class.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals("getUniqueId")) { found = true; break; } } ...
2
static String quote(String path){ byte[] _path=str2byte(path); int count=0; for(int i=0;i<_path.length; i++){ byte b=_path[i]; if(b=='\\' || b=='?' || b=='*') count++; } if(count==0) return path; byte[] _path2=new byte[_path.length+count]; for(int i=0, j=0; i<_path....
9
public void init(String n,int id){ if(n.equals("Etudiant")) etat = Etat.Etudiant; else if (n.equals("Etudiant1")){ etat = Etat.Etudiant1; try { this.etudiant = new Etudiant(id); } catch (SQLException ex) { Logger.getLogger(N...
4
public String getName() { return name; }
0
protected void floatLoop(RasterAccessor src, RasterAccessor dst, int filterSize) { int dwidth = dst.getWidth(); int dheight = dst.getHeight(); int dnumBands = dst.getNumBands(); float dstDataArrays[][] = dst.getFloatDataArrays...
9
private void setSecondAspectForJump(String firstAspect) { if (firstAspect!= null){ //setSecondAspectGroupEnabled(false); setSecondAspectGroupEnabled(true); if (firstAspect.equals(AData.L)){ l2.setEnabled(false); } else if(firstAs...
9
public synchronized void remoteUpdateGUI(byte keyState) { if ((keyState & m_controller.FORWARD_BIT) > 0) { updateDirectionIcon(0, true); } else { updateDirectionIcon(0, false); } if ((keyState & m_controller.BACKWARD_BIT) > 0) { updateDire...
4
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String submitButton = (String) request.getParameter("submit_btn"); int targetQuizID = Integer.parseInt(request.getParameter("target_quizid")); Quiz quiz = Quiz.getQuizByQuizID(targetQuizID); in...
7
private boolean isOnScreen(AbstractActor a) { int rightEdge = x + backImg.getWidth(main.getImageObserver()); int height = backImg.getHeight(main.getImageObserver()); if(a instanceof Block) { return (a.getXPos() + a.getWidth() >= x && a.getXPos() ...
5
public void cargarArbol() { //inicializo el arbol inicializarArbol(); //cargo las cuentas hijo r_con.Connection(); int count = 0; int aux = 0; Enumeration e = root1.breadthFirstEnumeration(); while (e.hasMoreElements()) { par...
6
public void convertInstr_index(String instr_index){ int i = Integer.parseInt(instr_index); String b = Integer.toBinaryString(i); char[] c = new char[((b.toCharArray().length > 26) ? 26 : b.toCharArray().length)]; System.arraycopy(b.toCharArray(), ((b.toCharArray().length > 26) ? 26 : 0),...
5
public void right() { switch(Main.Screen) { case "inGame": Main.inGameManager.buttonP(3); break; } }
1
public void onUpdate() { this.lastActiveTime = this.timeSinceIgnited; if(this.worldObj.multiplayerWorld) { int var1 = this.getCreeperState(); if(var1 > 0 && this.timeSinceIgnited == 0) { this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F); } this...
8
private int getNormalGoodsPriceToBuy(GoodsType type, int amount) { final int tradeGoodsAdd = 20; // Fake additional trade goods present final int capacity = getGoodsCapacity(); int current = getGoodsCount(type); // Increase effective stock if its raw material is produced here. G...
9
Space[][] openSets(Space sp) { Space[][] sets = new Space[numOpenSets(sp)][5]; int index = 0; if (numOpenSets(sp) != 0) { if (isOpen(board[sp.pos[0]], sp.piece, 1)) { sets[index] = board[sp.pos[0]]; index++; } if (isOpen(getColumn(sp.pos[1]), sp.piece, 1)) { sets[index] = getColumn(sp.pos[1])...
7
public Joining(String alias) { station = alias; }
0
public int getArrayIndex(int... ind) { if(ind.length == indexDim) { if(ind.length == 1) { return ind[0]; } if(ind.length == 2) { if(this.checkIndex(0, ind[0]) == false || this.checkIndex(1, ind[1]) == false) { ...
9