public void AddBehaviorBeforeSkillParentSetTest() { var skillsBehavior = new SkillsBehavior(null); var testSkill = new SkillUnarmed(); playerThing.Behaviors.Add(skillsBehavior); skillsBehavior.Add(testSkill); var behavior = playerThing.FindBehavior <SkillsBehavior>(); Assert.IsTrue(playerThing.FindBehavior <SkillsBehavior>().ManagedSkills.Contains(testSkill)); Assert.IsNotNull(testSkill.PlayerThing); behavior.Remove(testSkill); playerThing.Behaviors.Remove(skillsBehavior); }
public void AddSkillBeforeBehaviorParentSetTest() { var skillsBehavior = new SkillsBehavior(null); var testSkill = new SkillUnarmed(); skillsBehavior.Add(testSkill); this.playerThing.Behaviors.Add(skillsBehavior); var behavior = this.playerThing.Behaviors.FindFirst <SkillsBehavior>(); Assert.IsTrue(behavior.ManagedSkills.Contains(testSkill)); Assert.IsNotNull(testSkill.PlayerThing); behavior.Remove(testSkill); this.playerThing.Behaviors.Remove(skillsBehavior); }