public void Start() { Game game = (new Menu()).getGame(); if (game.players.Length < 1 || game.players.Length > 4) { throw new Exception("An invalid game was passed to the GameMaster.\nThe number of players is invalid."); } //Some logic for creating players. switch (game.mode) { case ModeTypes.Battle: rules = new BattleRules(); break; case ModeTypes.Classic: rules = new ClassicRules(); break; case ModeTypes.GhostTag: rules = new TagRules(); break; } // elements.AddRange(rules.GetElements()); elements.AddRange(PlayerElements); board = new Board(elements.ToArray(), rules); }
public void Start() { Game game = (new Menu()).getGame(); if (game.players.Length < 1 || game.players.Length > 4) { throw new Exception("An invalid game was passed to the GameMaster.\nThe number of players is invalid."); } elements = new Element[game.players.Length]; for (int i = 0; i < elements.Length; i++) { elements[i] = new Element(game.players[i], game.controls[i], game.schemes[i]); } switch (game.mode) { case ModeTypes.Battle: rules = new BattleRules(); break; case ModeTypes.Classic: rules = new ClassRules(); break; case ModeTypes.GhostTag: rules = new TagRules(); break; } board = new Board(elements, rules); }
public void Start() { Game game = (new Menu()).getGame(); if (game.players.Length < 1 || game.players.Length > 4) throw new Exception("An invalid game was passed to the GameMaster.\nThe number of players is invalid."); //Some logic for creating players. switch (game.mode) { case ModeTypes.Battle: rules = new BattleRules(); break; case ModeTypes.Classic: rules = new ClassicRules(); break; case ModeTypes.GhostTag: rules = new TagRules(); break; } // elements.AddRange(rules.GetElements()); elements.AddRange(PlayerElements); board = new Board(elements.ToArray(), rules); }
public Board(Element[] elements, RulesI rules) { this.elements = elements; this.rules = rules; }