@Override public void serialize(EasyBuffering p_buf) { p_buf.put(playerName); p_buf.put(zildoId); p_buf.put(nDied); p_buf.put(nKill); }
/** Serialize this chaining point. */ @Override public void serialize(EasyBuffering p_buffer) { int saveX = px; int saveY = py; if (single) { saveX |= 64; } if (vertical) { saveX |= 128; } if (border) { saveY |= 128; } p_buffer.put((byte) saveX); p_buffer.put((byte) saveY); p_buffer.put((byte) comingAngle.value); p_buffer.put((byte) transitionAnim.ordinal()); p_buffer.put(mapname); }
/** * Add given server to the server file {@link Constantes#SERVER_FILE} * * @param p_serverInfo */ private void saveServerInfos(ServerInfo p_serverInfo) { // Read the file List<ServerInfo> infos = loadServersInfos(); // Replace server with same name, if needed. int idx = infos.indexOf(p_serverInfo); if (idx != -1) { infos.remove(idx); } infos.add(p_serverInfo); // And save the file EasyBuffering buffer = new EasyBuffering(); for (ServerInfo info : infos) { buffer.put(info.name); buffer.put(info.ip); buffer.put(info.port); } EasyWritingFile file = new EasyWritingFile(buffer); file.saveFile(Constantes.SERVER_FILE); }