Esempio n. 1
0
        public void NewGame()
        {
            var gen = new SystemGenerator();
            var systems = gen.GenerateSystems();

            _ctx = new GameContext(systems, context => Debug.WriteLine("State changed"));

            _ctx.StartTurn();
        }
Esempio n. 2
0
        public void tick(GameContext context)
        {
            var playerResourceChanges = new List<ResourceDelta>();

            foreach (var value in context.Systems)
            {
                if (value.Owner == _player.PlayerNumber)
                {
                    var resourceChanges = value.ProgressOneTurn();
                    foreach (var change in resourceChanges)
                    {
                        playerResourceChanges.Add(change);
                    }
                }
            }

            foreach (var change in playerResourceChanges)
            {
                _player.ModifyResources(change);
            }
        }
Esempio n. 3
0
 public void Initialize()
 {
     _ctx = new GameContext(new SystemGenerator().GenerateSystems(), x => { });
 }