Ejemplo n.º 1
0
 public static void ValidatePlayerType(this GameDef gameDef, PlayerTypeDefId playerTypeDefId, string hint)
 {
     if (!gameDef.PlayerTypes.Any(x => x.Id.Equals(playerTypeDefId)))
     {
         throw new InvalidGameDefException($"Player type '{playerTypeDefId}' not found. Check '{hint}'!");
     }
 }
Ejemplo n.º 2
0
 public static IEnumerable <UnitDef> GetUnitsByPlayerType(this GameDef gameDef, PlayerTypeDefId playerTypeId)
 {
     return(gameDef.Units.Where(x => x.PlayerTypeRestriction.Equals(playerTypeId)));
 }