예제 #1
0
파일: Game.cs 프로젝트: CSF-VSU/SpacePewPew
        public void StartNewGame()
        {
            Map.CreateEmptyMap(Consts.MAP_WIDTH, Consts.MAP_HEIGHT);

            Players = new List<Player>(2) {new Player(PlayerColor.Red, RaceName.Human, true),
                                            new Player(PlayerColor.Blue, RaceName.Human, true)};
            _currentPlayer = Players[0];
        }
예제 #2
0
파일: Game.cs 프로젝트: CSF-VSU/SpacePewPew
        public void Tick()
        {
            if (--_currentPlayer.TimeLeft == 0)
            {
                _currentPlayer = PassTurn();
                return;
            }

            var decision = _currentPlayer.Strategy.MakeDecision(Map);

            if (decision != null && !IsShowingModal)
                Drawer.Instance().DecisionHandler(this, new DecisionArgs { Decision = decision });
        }
예제 #3
0
파일: Game.cs 프로젝트: CSF-VSU/SpacePewPew
 public void LoadGame(GameState state)
 {
     Players = state.Players;
     //TODO: добавить в файл сохранения информацию о том, который из игроков ходит.
     _currentPlayer = Players[0];
     Map.LoadFrom(state.Map);
 }