示例#1
0
 /// <summary>
 /// Gets the Generation the <see cref="GameVersion"/> belongs to.
 /// </summary>
 /// <param name="game">Game to retrieve the generation for</param>
 /// <returns>Generation ID</returns>
 public static int GetGeneration(this GameVersion game)
 {
     if (Gen1.Contains(game))
     {
         return(1);
     }
     if (Gen2.Contains(game))
     {
         return(2);
     }
     if (Gen3.Contains(game))
     {
         return(3);
     }
     if (Gen4.Contains(game))
     {
         return(4);
     }
     if (Gen5.Contains(game))
     {
         return(5);
     }
     if (Gen6.Contains(game))
     {
         return(6);
     }
     if (Gen7.Contains(game))
     {
         return(7);
     }
     return(-1);
 }
示例#2
0
 /// <summary>
 /// Gets the Generation the <see cref="GameVersion"/> belongs to.
 /// </summary>
 /// <param name="game">Game to retrieve the generation for</param>
 /// <returns>Generation ID</returns>
 public static int GetMaxSpeciesID(this GameVersion game)
 {
     if (Gen1.Contains(game))
     {
         return(Legal.MaxSpeciesID_1);
     }
     if (Gen2.Contains(game))
     {
         return(Legal.MaxSpeciesID_2);
     }
     if (Gen3.Contains(game))
     {
         return(Legal.MaxSpeciesID_3);
     }
     if (Gen4.Contains(game))
     {
         return(Legal.MaxSpeciesID_4);
     }
     if (Gen5.Contains(game))
     {
         return(Legal.MaxSpeciesID_5);
     }
     if (Gen6.Contains(game))
     {
         return(Legal.MaxSpeciesID_6);
     }
     if (Gen7.Contains(game))
     {
         if (SM.Contains(game))
         {
             return(Legal.MaxSpeciesID_7);
         }
         if (USUM.Contains(game))
         {
             return(Legal.MaxSpeciesID_7_USUM);
         }
         if (GG.Contains(game))
         {
             return(Legal.MaxSpeciesID_7b);
         }
         return(Legal.MaxSpeciesID_7_USUM);
     }
     return(-1);
 }
示例#3
0
文件: GameUtil.cs 项目: wooddice/pkNX
 /// <summary>
 /// Gets the Generation the <see cref="GameVersion"/> belongs to.
 /// </summary>
 /// <param name="game">Game to retrieve the generation for</param>
 /// <returns>Generation ID</returns>
 public static int GetMaxSpeciesID(this GameVersion game)
 {
     if (Gen1.Contains(game))
     {
         return(151);
     }
     if (Gen2.Contains(game))
     {
         return(251);
     }
     if (Gen3.Contains(game))
     {
         return(384);
     }
     if (Gen4.Contains(game))
     {
         return(493);
     }
     if (Gen5.Contains(game))
     {
         return(649);
     }
     if (Gen6.Contains(game))
     {
         return(Legal.MaxSpeciesID_6);
     }
     if (Gen7.Contains(game))
     {
         if (SM.Contains(game))
         {
             return(802);
         }
         if (USUM.Contains(game))
         {
             return(807);
         }
         return(Legal.MaxSpeciesID_7_GG);
     }
     return(-1);
 }