Esempio n. 1
0
        public TurnManager DeepCopy(GameInstance gameCopy)
        {
            var copy = new TurnManager(gameCopy);

            if (PresortedOrder == null)
            {
                Utils.Log(LogSeverity.Warning, nameof(TurnManager),
                          "Initiated DeepCopy on an uninitialized GameInstance");
                PresortTurnOrder();
            }

            copy.PresortedOrder = PresortedOrder.ToList();

            return(copy);
        }
Esempio n. 2
0
        public GameInstance(Map map, MobManager mobManager)
        {
            Map        = map;
            MobManager = mobManager;

            Size        = map.Size;
            Pathfinder  = new Pathfinder(this);
            TurnManager = new TurnManager(this);
            State       = new GameState();

            Array.Resize(ref State.MobInstances, mobManager.Mobs.Count);

            for (int i = 0; i < MobManager.Abilities.Count; i++)
            {
                State.Cooldowns.Add(0);
            }
            foreach (var mobId in MobManager.Mobs)
            {
                State.MobInstances[mobId].Id = mobId;
            }
        }
Esempio n. 3
0
 public void PrepareTurnOrder()
 {
     TurnManager.PresortTurnOrder();
     State.Reset(this);
 }