Esempio n. 1
0
        static void Main(string[] args)
        {
            Setup();
            BattlePetInfo pet1 = (BattlePetInfo)battlePetStorage.GetItemByID("1");
            BattlePetInfo pet2 = (BattlePetInfo)battlePetStorage.GetItemByID("1");
            BattlePetInfo pet3 = (BattlePetInfo)battlePetStorage.GetItemByID("1");

            PetBattler opponent = new PetBattler(new BattlePet(pet1, 25), new BattlePet(pet2, 25), new BattlePet(pet3, 25));

            BattlePetCollectionStatistics stats = battlePetSuggestionController.GetOpponentStatistics(opponent);

            Console.WriteLine(ObjectToJson.BattlePetCollectionStatistics(stats));

            Console.ReadLine();
        }
Esempio n. 2
0
        public BattlePetCollectionStatistics GetOpponentStatistics(PetBattler opponent)
        {
            BattlePetSpecies[]            opponentMoveTypes  = new BattlePetSpecies[(opponent.battlePets.Length * opponent.battlePets[0].battlePetInfo.battlePetMoveSet.moves.Length)];
            BattlePetSpecies[]            opponentSpecies    = new BattlePetSpecies[opponent.battlePets.Length];
            BattlePetCollectionStatistics opponentStatistics = new BattlePetCollectionStatistics();

            int battlePetMoveIndex = 0;

            for (int i = 0; i < opponent.battlePets.Length; i++)
            {
                opponentSpecies[i] = opponent.battlePets[i].battlePetInfo.battlePetSpecies;

                for (int j = 0; j < opponent.battlePets[i].battlePetInfo.battlePetMoveSet.moves.Length; j++)
                {
                    opponentMoveTypes[battlePetMoveIndex] = opponent.battlePets[i].battlePetInfo.battlePetMoveSet.moves[j].damageType;
                    battlePetMoveIndex++;
                }
            }

            opponentStatistics.speciesOfBattlePets     = opponentSpecies;
            opponentStatistics.speciesOfBattlePetMoves = opponentMoveTypes;
            return(opponentStatistics);
        }
Esempio n. 3
0
 public static string BattlePetCollectionStatistics(BattlePetCollectionStatistics battlePetCollectionStatistics)
 {
     return(JsonConvert.SerializeObject(battlePetCollectionStatistics, Formatting.Indented));
 }