示例#1
0
        public void TestCanChangeAgentStrategy()
        {
            Agent a = new Agent();

            a.Update(0f);

            AIBehaviour subBehaviour = Substitute.For <AIBehaviour>();

            subBehaviour.GetName().Returns("AiBehaviourSub");

            a.Controller.SetBehaviour(subBehaviour);
            Assert.AreEqual("AiBehaviourSub", a.Controller.GetBehaviourName());

            a.Update(1f);
            Assert.AreEqual("AiBehaviourSub", a.Controller.GetBehaviourName());

            a.Controller.ClearBehaviour();
            Assert.AreEqual("AiBehaviourDefault", a.Controller.GetBehaviourName());
        }
示例#2
0
 public string GetBehaviourName()
 {
     return(_behaviour.GetName());
 }