/** * Autogenerated by Thrift Compiler (0.8.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.riksa.bombah.thrift; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MapState implements org.apache.thrift.TBase<MapState, MapState._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MapState"); private static final org.apache.thrift.protocol.TField TILES_FIELD_DESC = new org.apache.thrift.protocol.TField("tiles", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField BOMBS_FIELD_DESC = new org.apache.thrift.protocol.TField("bombs", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField PLAYERS_FIELD_DESC = new org.apache.thrift.protocol.TField("players", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.protocol.TField CURRENT_TICK_FIELD_DESC = new org.apache.thrift.protocol.TField("currentTick", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField FLAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("flames", org.apache.thrift.protocol.TType.LIST, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new MapStateStandardSchemeFactory()); schemes.put(TupleScheme.class, new MapStateTupleSchemeFactory()); } public List<Tile> tiles; // required public List<BombState> bombs; // required public List<PlayerState> players; // required public int currentTick; // required public List<FlameState> flames; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TILES((short)1, "tiles"), BOMBS((short)2, "bombs"), PLAYERS((short)3, "players"), CURRENT_TICK((short)4, "currentTick"), FLAMES((short)5, "flames"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TILES return TILES; case 2: // BOMBS return BOMBS; case 3: // PLAYERS return PLAYERS; case 4: // CURRENT_TICK return CURRENT_TICK; case 5: // FLAMES return FLAMES; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __CURRENTTICK_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TILES, new org.apache.thrift.meta_data.FieldMetaData("tiles", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Tile.class)))); tmpMap.put(_Fields.BOMBS, new org.apache.thrift.meta_data.FieldMetaData("bombs", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BombState.class)))); tmpMap.put(_Fields.PLAYERS, new org.apache.thrift.meta_data.FieldMetaData("players", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PlayerState.class)))); tmpMap.put(_Fields.CURRENT_TICK, new org.apache.thrift.meta_data.FieldMetaData("currentTick", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.FLAMES, new org.apache.thrift.meta_data.FieldMetaData("flames", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FlameState.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MapState.class, metaDataMap); } public MapState() { } public MapState( List<Tile> tiles, List<BombState> bombs, List<PlayerState> players, int currentTick, List<FlameState> flames) { this(); this.tiles = tiles; this.bombs = bombs; this.players = players; this.currentTick = currentTick; setCurrentTickIsSet(true); this.flames = flames; } /** * Performs a deep copy on <i>other</i>. */ public MapState(MapState other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetTiles()) { List<Tile> __this__tiles = new ArrayList<Tile>(); for (Tile other_element : other.tiles) { __this__tiles.add(other_element); } this.tiles = __this__tiles; } if (other.isSetBombs()) { List<BombState> __this__bombs = new ArrayList<BombState>(); for (BombState other_element : other.bombs) { __this__bombs.add(new BombState(other_element)); } this.bombs = __this__bombs; } if (other.isSetPlayers()) { List<PlayerState> __this__players = new ArrayList<PlayerState>(); for (PlayerState other_element : other.players) { __this__players.add(new PlayerState(other_element)); } this.players = __this__players; } this.currentTick = other.currentTick; if (other.isSetFlames()) { List<FlameState> __this__flames = new ArrayList<FlameState>(); for (FlameState other_element : other.flames) { __this__flames.add(new FlameState(other_element)); } this.flames = __this__flames; } } public MapState deepCopy() { return new MapState(this); } @Override public void clear() { this.tiles = null; this.bombs = null; this.players = null; setCurrentTickIsSet(false); this.currentTick = 0; this.flames = null; } public int getTilesSize() { return (this.tiles == null) ? 0 : this.tiles.size(); } public java.util.Iterator<Tile> getTilesIterator() { return (this.tiles == null) ? null : this.tiles.iterator(); } public void addToTiles(Tile elem) { if (this.tiles == null) { this.tiles = new ArrayList<Tile>(); } this.tiles.add(elem); } public List<Tile> getTiles() { return this.tiles; } public MapState setTiles(List<Tile> tiles) { this.tiles = tiles; return this; } public void unsetTiles() { this.tiles = null; } /** Returns true if field tiles is set (has been assigned a value) and false otherwise */ public boolean isSetTiles() { return this.tiles != null; } public void setTilesIsSet(boolean value) { if (!value) { this.tiles = null; } } public int getBombsSize() { return (this.bombs == null) ? 0 : this.bombs.size(); } public java.util.Iterator<BombState> getBombsIterator() { return (this.bombs == null) ? null : this.bombs.iterator(); } public void addToBombs(BombState elem) { if (this.bombs == null) { this.bombs = new ArrayList<BombState>(); } this.bombs.add(elem); } public List<BombState> getBombs() { return this.bombs; } public MapState setBombs(List<BombState> bombs) { this.bombs = bombs; return this; } public void unsetBombs() { this.bombs = null; } /** Returns true if field bombs is set (has been assigned a value) and false otherwise */ public boolean isSetBombs() { return this.bombs != null; } public void setBombsIsSet(boolean value) { if (!value) { this.bombs = null; } } public int getPlayersSize() { return (this.players == null) ? 0 : this.players.size(); } public java.util.Iterator<PlayerState> getPlayersIterator() { return (this.players == null) ? null : this.players.iterator(); } public void addToPlayers(PlayerState elem) { if (this.players == null) { this.players = new ArrayList<PlayerState>(); } this.players.add(elem); } public List<PlayerState> getPlayers() { return this.players; } public MapState setPlayers(List<PlayerState> players) { this.players = players; return this; } public void unsetPlayers() { this.players = null; } /** Returns true if field players is set (has been assigned a value) and false otherwise */ public boolean isSetPlayers() { return this.players != null; } public void setPlayersIsSet(boolean value) { if (!value) { this.players = null; } } public int getCurrentTick() { return this.currentTick; } public MapState setCurrentTick(int currentTick) { this.currentTick = currentTick; setCurrentTickIsSet(true); return this; } public void unsetCurrentTick() { __isset_bit_vector.clear(__CURRENTTICK_ISSET_ID); } /** Returns true if field currentTick is set (has been assigned a value) and false otherwise */ public boolean isSetCurrentTick() { return __isset_bit_vector.get(__CURRENTTICK_ISSET_ID); } public void setCurrentTickIsSet(boolean value) { __isset_bit_vector.set(__CURRENTTICK_ISSET_ID, value); } public int getFlamesSize() { return (this.flames == null) ? 0 : this.flames.size(); } public java.util.Iterator<FlameState> getFlamesIterator() { return (this.flames == null) ? null : this.flames.iterator(); } public void addToFlames(FlameState elem) { if (this.flames == null) { this.flames = new ArrayList<FlameState>(); } this.flames.add(elem); } public List<FlameState> getFlames() { return this.flames; } public MapState setFlames(List<FlameState> flames) { this.flames = flames; return this; } public void unsetFlames() { this.flames = null; } /** Returns true if field flames is set (has been assigned a value) and false otherwise */ public boolean isSetFlames() { return this.flames != null; } public void setFlamesIsSet(boolean value) { if (!value) { this.flames = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TILES: if (value == null) { unsetTiles(); } else { setTiles((List<Tile>)value); } break; case BOMBS: if (value == null) { unsetBombs(); } else { setBombs((List<BombState>)value); } break; case PLAYERS: if (value == null) { unsetPlayers(); } else { setPlayers((List<PlayerState>)value); } break; case CURRENT_TICK: if (value == null) { unsetCurrentTick(); } else { setCurrentTick((Integer)value); } break; case FLAMES: if (value == null) { unsetFlames(); } else { setFlames((List<FlameState>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TILES: return getTiles(); case BOMBS: return getBombs(); case PLAYERS: return getPlayers(); case CURRENT_TICK: return Integer.valueOf(getCurrentTick()); case FLAMES: return getFlames(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TILES: return isSetTiles(); case BOMBS: return isSetBombs(); case PLAYERS: return isSetPlayers(); case CURRENT_TICK: return isSetCurrentTick(); case FLAMES: return isSetFlames(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof MapState) return this.equals((MapState)that); return false; } public boolean equals(MapState that) { if (that == null) return false; boolean this_present_tiles = true && this.isSetTiles(); boolean that_present_tiles = true && that.isSetTiles(); if (this_present_tiles || that_present_tiles) { if (!(this_present_tiles && that_present_tiles)) return false; if (!this.tiles.equals(that.tiles)) return false; } boolean this_present_bombs = true && this.isSetBombs(); boolean that_present_bombs = true && that.isSetBombs(); if (this_present_bombs || that_present_bombs) { if (!(this_present_bombs && that_present_bombs)) return false; if (!this.bombs.equals(that.bombs)) return false; } boolean this_present_players = true && this.isSetPlayers(); boolean that_present_players = true && that.isSetPlayers(); if (this_present_players || that_present_players) { if (!(this_present_players && that_present_players)) return false; if (!this.players.equals(that.players)) return false; } boolean this_present_currentTick = true; boolean that_present_currentTick = true; if (this_present_currentTick || that_present_currentTick) { if (!(this_present_currentTick && that_present_currentTick)) return false; if (this.currentTick != that.currentTick) return false; } boolean this_present_flames = true && this.isSetFlames(); boolean that_present_flames = true && that.isSetFlames(); if (this_present_flames || that_present_flames) { if (!(this_present_flames && that_present_flames)) return false; if (!this.flames.equals(that.flames)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(MapState other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; MapState typedOther = (MapState)other; lastComparison = Boolean.valueOf(isSetTiles()).compareTo(typedOther.isSetTiles()); if (lastComparison != 0) { return lastComparison; } if (isSetTiles()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tiles, typedOther.tiles); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBombs()).compareTo(typedOther.isSetBombs()); if (lastComparison != 0) { return lastComparison; } if (isSetBombs()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bombs, typedOther.bombs); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPlayers()).compareTo(typedOther.isSetPlayers()); if (lastComparison != 0) { return lastComparison; } if (isSetPlayers()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.players, typedOther.players); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCurrentTick()).compareTo(typedOther.isSetCurrentTick()); if (lastComparison != 0) { return lastComparison; } if (isSetCurrentTick()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentTick, typedOther.currentTick); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFlames()).compareTo(typedOther.isSetFlames()); if (lastComparison != 0) { return lastComparison; } if (isSetFlames()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flames, typedOther.flames); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("MapState("); boolean first = true; sb.append("tiles:"); if (this.tiles == null) { sb.append("null"); } else { sb.append(this.tiles); } first = false; if (!first) sb.append(", "); sb.append("bombs:"); if (this.bombs == null) { sb.append("null"); } else { sb.append(this.bombs); } first = false; if (!first) sb.append(", "); sb.append("players:"); if (this.players == null) { sb.append("null"); } else { sb.append(this.players); } first = false; if (!first) sb.append(", "); sb.append("currentTick:"); sb.append(this.currentTick); first = false; if (!first) sb.append(", "); sb.append("flames:"); if (this.flames == null) { sb.append("null"); } else { sb.append(this.flames); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bit_vector = new BitSet(1); read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class MapStateStandardSchemeFactory implements SchemeFactory { public MapStateStandardScheme getScheme() { return new MapStateStandardScheme(); } } private static class MapStateStandardScheme extends StandardScheme<MapState> { public void read(org.apache.thrift.protocol.TProtocol iprot, MapState struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TILES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.tiles = new ArrayList<Tile>(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { Tile _elem2; // required _elem2 = Tile.findByValue(iprot.readI32()); struct.tiles.add(_elem2); } iprot.readListEnd(); } struct.setTilesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // BOMBS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); struct.bombs = new ArrayList<BombState>(_list3.size); for (int _i4 = 0; _i4 < _list3.size; ++_i4) { BombState _elem5; // required _elem5 = new BombState(); _elem5.read(iprot); struct.bombs.add(_elem5); } iprot.readListEnd(); } struct.setBombsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PLAYERS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); struct.players = new ArrayList<PlayerState>(_list6.size); for (int _i7 = 0; _i7 < _list6.size; ++_i7) { PlayerState _elem8; // required _elem8 = new PlayerState(); _elem8.read(iprot); struct.players.add(_elem8); } iprot.readListEnd(); } struct.setPlayersIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CURRENT_TICK if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.currentTick = iprot.readI32(); struct.setCurrentTickIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // FLAMES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list9 = iprot.readListBegin(); struct.flames = new ArrayList<FlameState>(_list9.size); for (int _i10 = 0; _i10 < _list9.size; ++_i10) { FlameState _elem11; // required _elem11 = new FlameState(); _elem11.read(iprot); struct.flames.add(_elem11); } iprot.readListEnd(); } struct.setFlamesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, MapState struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.tiles != null) { oprot.writeFieldBegin(TILES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.tiles.size())); for (Tile _iter12 : struct.tiles) { oprot.writeI32(_iter12.getValue()); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.bombs != null) { oprot.writeFieldBegin(BOMBS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.bombs.size())); for (BombState _iter13 : struct.bombs) { _iter13.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.players != null) { oprot.writeFieldBegin(PLAYERS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.players.size())); for (PlayerState _iter14 : struct.players) { _iter14.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldBegin(CURRENT_TICK_FIELD_DESC); oprot.writeI32(struct.currentTick); oprot.writeFieldEnd(); if (struct.flames != null) { oprot.writeFieldBegin(FLAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.flames.size())); for (FlameState _iter15 : struct.flames) { _iter15.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class MapStateTupleSchemeFactory implements SchemeFactory { public MapStateTupleScheme getScheme() { return new MapStateTupleScheme(); } } private static class MapStateTupleScheme extends TupleScheme<MapState> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, MapState struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetTiles()) { optionals.set(0); } if (struct.isSetBombs()) { optionals.set(1); } if (struct.isSetPlayers()) { optionals.set(2); } if (struct.isSetCurrentTick()) { optionals.set(3); } if (struct.isSetFlames()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetTiles()) { { oprot.writeI32(struct.tiles.size()); for (Tile _iter16 : struct.tiles) { oprot.writeI32(_iter16.getValue()); } } } if (struct.isSetBombs()) { { oprot.writeI32(struct.bombs.size()); for (BombState _iter17 : struct.bombs) { _iter17.write(oprot); } } } if (struct.isSetPlayers()) { { oprot.writeI32(struct.players.size()); for (PlayerState _iter18 : struct.players) { _iter18.write(oprot); } } } if (struct.isSetCurrentTick()) { oprot.writeI32(struct.currentTick); } if (struct.isSetFlames()) { { oprot.writeI32(struct.flames.size()); for (FlameState _iter19 : struct.flames) { _iter19.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, MapState struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.tiles = new ArrayList<Tile>(_list20.size); for (int _i21 = 0; _i21 < _list20.size; ++_i21) { Tile _elem22; // required _elem22 = Tile.findByValue(iprot.readI32()); struct.tiles.add(_elem22); } } struct.setTilesIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.bombs = new ArrayList<BombState>(_list23.size); for (int _i24 = 0; _i24 < _list23.size; ++_i24) { BombState _elem25; // required _elem25 = new BombState(); _elem25.read(iprot); struct.bombs.add(_elem25); } } struct.setBombsIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list26 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.players = new ArrayList<PlayerState>(_list26.size); for (int _i27 = 0; _i27 < _list26.size; ++_i27) { PlayerState _elem28; // required _elem28 = new PlayerState(); _elem28.read(iprot); struct.players.add(_elem28); } } struct.setPlayersIsSet(true); } if (incoming.get(3)) { struct.currentTick = iprot.readI32(); struct.setCurrentTickIsSet(true); } if (incoming.get(4)) { { org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.flames = new ArrayList<FlameState>(_list29.size); for (int _i30 = 0; _i30 < _list29.size; ++_i30) { FlameState _elem31; // required _elem31 = new FlameState(); _elem31.read(iprot); struct.flames.add(_elem31); } } struct.setFlamesIsSet(true); } } } }