Beispiel #1
0
        public static Game CreateGame(GameFormats format)
        {
            switch (format)
            {
            case GameFormats.Singles:
                return(new SinglesGame());

            case GameFormats.Doubles:
                return(new DoublesGame());

            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
            }
        }
Beispiel #2
0
 public static void ValidateGameFormat(ValidationResult validationResult, Entities.Competition competition, GameFormats gameFormat)
 {
     if (competition.GetEntryGameFormat() != gameFormat)
     {
         validationResult.Errors.Add(new ValidationFailure("GameFormat", "Invalid Game Format."));
     }
 }
Beispiel #3
0
 public Game(GameFormats gameFormatID)
 {
     this._players     = new List <GameXPlayer>();
     this.GameFormatID = gameFormatID;
 }