Ejemplo n.º 1
0
        public void Apply_NotACharacter_Test()
        {
            var entity  = Mock.Of <IEntity>();
            var fleeing = new Fleeing();

            fleeing.Apply(entity);
            Assert.IsTrue(true); // If we made it here without exception then the test passed
        }
Ejemplo n.º 2
0
        public void Remove_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var fleeing   = new Fleeing();

            fleeing.Apply(character);
            fleeing.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
Ejemplo n.º 3
0
        public void Apply_Character_WithExistingFleeingCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Fleeing());
            var fleeing = new Fleeing();

            fleeing.Apply(character);
        }
Ejemplo n.º 4
0
        public void Apply_Character_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var fleeing   = new Fleeing();

            fleeing.Apply(character);
            Assert.AreEqual(EntityIds.FLEEING_CONDITION_ID, character.Conditions[0].Id);
            Assert.AreSame(fleeing, character.Conditions[0]);
        }
Ejemplo n.º 5
0
    private Fleeing()
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
    }
Ejemplo n.º 6
0
 public Fleeing(Fleeing from) : base(from)
 {
 }
 public StateContainer()
 {
     flee = new Fleeing();
     hunt = new Hunting();
     wander = new Wandering();
 }
Ejemplo n.º 8
0
 public StateContainer()
 {
     flee   = new Fleeing();
     hunt   = new Hunting();
     wander = new Wandering();
 }