Exemplo n.º 1
0
        public Move PickRandomMove(Pokemon pokemon)
        {
            if (NoPPCheck(pokemon))
            {
                return(NoPPMove());
            }
NoPPOnMove:
            var random = new Random();
            var getalNext = random.Next(0, pokemon.GetMoves().Count());

            if (pokemon.GetMoves()[getalNext].CurrentPP > 0)
            {
                return(pokemon.GetMoves()[getalNext]);
            }
            goto NoPPOnMove;
        }
Exemplo n.º 2
0
 /// <summary>
 /// This Function checks the PP on moves
 /// </summary>
 /// <param name="pokemon">Pokemon to check</param>
 /// <returns>true on no pp</returns>
 public bool NoPPCheck(Pokemon pokemon)
 {
     return(pokemon.GetMoves().All(move => move.CurrentPP <= 0));
 }