Пример #1
0
        public void UpdateState()
        {
            if (!MobileObjectsManager.CreatureContainsInGame(Player))
            {
                PlayerLost = true;
                return;
            }

            if (Player.Inventory.Cost == MapManager.LevelCost)
            {
                PlayerWon = true;
                return;
            }

            foreach (var creature in MobileObjectsManager.MobileObjects)
            {
                var query = creature.GetIntention();
                if (ValidateRequest(query, creature))
                {
                    ExecuteIntention(query, creature);
                    creature.ActionTaken(query);
                }
                else
                {
                    creature.ActionRejected(query);
                }
            }

            TemporaryObjectsManager.UpdateTemporaryObjects();
            MobileObjectsManager.UpdateAnimates();
        }
Пример #2
0
 public void TestCreatingCreature()
 {
     GameSetter.SetSampleMap(2, 2);
     MobileObjectsManager.CreateCreature(
         new Player(new MobileObjectInitialization(new Point(0, 0), Direction.Down)));
     MobileObjectsManager.UpdateAnimates();
     Assert.True(MapManager.Map[0, 0].Creature is Player);
 }