Exemple #1
0
        public BoardController()
        {
            SaveHandler = new SaveHandler();

            gameFromFile();
            ruleEngine = new RuleEngine(State.Board);
            logicEngine = new LogicEngine(State.Board);
            SaveHandler.OnManualSaveChange += gameFromFile;
        }
Exemple #2
0
 private void newGame(int nrOfPlayers)
 {
     State = new GameState();
     if (nrOfPlayers < 2) throw new ArgumentException("Must have at least two players");
     State.Board = Loader.LoadBoard();
     addThiefPlayers(nrOfPlayers - 1);
     addPolicePlayer(nrOfPlayers);
     ruleEngine = new RuleEngine(State.Board);
     logicEngine = new LogicEngine(State.Board);
     State.CurrentPlayerDiceRoll = LogicEngine.diceRoll(); // Initial player roll
     State.CurrentPlayerIndex = State.Players.Count - 1;
     if (OnReloadedState != null) OnReloadedState();
 }