// Matching methods public PBS.Battle.View.WifiFriendly.Pokemon GetMatchingPokemon(PBS.Battle.View.Events.CommandAgent agent) { if (agent == null) { return(null); } return(GetMatchingPokemon(agent.pokemonUniqueID)); }
public static PBS.Battle.View.Events.CommandAgent ReadBattleViewEventCommandAgent(this NetworkReader reader) { PBS.Battle.View.Events.CommandAgent obj = new PBS.Battle.View.Events.CommandAgent { pokemonUniqueID = reader.ReadString(), canMegaEvolve = reader.ReadBoolean(), canZMove = reader.ReadBoolean(), canDynamax = reader.ReadBoolean(), isDynamaxed = reader.ReadBoolean(), moveslots = reader.ReadList <PBS.Battle.View.Events.CommandAgent.Moveslot>(), zMoveSlots = reader.ReadList <PBS.Battle.View.Events.CommandAgent.Moveslot>(), dynamaxMoveSlots = reader.ReadList <PBS.Battle.View.Events.CommandAgent.Moveslot>() }; obj.commandTypes = new List <BattleCommandType>(); List <int> commandInts = reader.ReadList <int>(); for (int i = 0; i < commandInts.Count; i++) { obj.commandTypes.Add((BattleCommandType)commandInts[i]); } return(obj); }
public BattlePosition GetPokemonPosition(PBS.Battle.View.Events.CommandAgent pokemon) { return(GetPokemonPosition(GetMatchingPokemon(pokemon.pokemonUniqueID))); }
public static void WriteBattleViewEventCommandAgent(this NetworkWriter writer, PBS.Battle.View.Events.CommandAgent obj) { writer.WriteString(obj.pokemonUniqueID); writer.WriteBoolean(obj.canMegaEvolve); writer.WriteBoolean(obj.canZMove); writer.WriteBoolean(obj.canDynamax); writer.WriteBoolean(obj.isDynamaxed); writer.WriteList(obj.moveslots); writer.WriteList(obj.zMoveSlots); writer.WriteList(obj.dynamaxMoveSlots); List <int> commandInts = new List <int>(); for (int i = 0; i < obj.commandTypes.Count; i++) { commandInts.Add((int)obj.commandTypes[i]); } writer.WriteList(commandInts); }