/// <summary> /// Constructor for the controller /// </summary> /// <param name = "deck"></param> /// <param name = "players"></param> private Controller(Deck deck, Player[] players) { Deck = deck; Board = new Board(); _players = players; Score = new Dictionary<IPlayer, int>(); TilePlacementRules = new RuleSet<TileMovementArguments>(RuleTypes.TilePlacement); TileRemovalRules = new RuleSet<TileMovementArguments>(RuleTypes.TileRemoval); TokenPlacementRules = new RuleSet<TokenMovementArguments>(RuleTypes.TokenPlacement); TokenRemovalRules = new RuleSet<TokenMovementArguments>(RuleTypes.TokenRemoval); Selection = Selection.TileFromHand; Board[0, 0].Tile = Deck.Pop(); Board[1, 0].Tile = Deck.Pop(); Board[0, -1].Tile = Deck.Pop(); // Each player starts with 5 tiles foreach (Player player in players) { Score[player] = 0; for (int i = 0; i<5; i++) player.AddToHand(Deck.Pop()); } ActivePlayerIndex = 0; ActivePlayer = players[ActivePlayerIndex]; Message = "Select a tile from your hand"; Selection = Selection.TileFromHand; TileQueue = new List<Tile>(); MaxTokens = 45; MaxSanctums = 10; SmallestScoringGroup = 3; }
/// <summary> /// Initializes a new game with the given deck and player list. /// </summary> public static void Initialize(Deck deck, params Player[] players) { _instance = new Controller(deck, players); }
/// <summary> /// Initializes a new game with the given deck and default player list. /// </summary> public static void Initialize(Deck deck) { Initialize(deck, _defaultPlayers); }