示例#1
0
        public void SceneCanAddCharacter()
        {
            var target = new Scene();
            Assert.AreEqual(0, target.Characters.Count);

            target.Add(new Character());
            target.Add(new Character());
            Assert.AreEqual(2, target.Characters.Count);
        }
示例#2
0
        public void SceneCanSetAct()
        {
            var target = new Scene();
            Assert.IsNull(target.Act);

            var act = new Act();
            target.Act = act;
            Assert.AreEqual(act, target.Act);
        }
示例#3
0
        public void SceneCanRemoveCharacter()
        {
            var target = new Scene();

            var character1 = new Character();
            var character2 = new Character();
            target.Add(character1);
            target.Add(character2);
            Assert.AreEqual(2, target.Characters.Count);

            target.Remove(character1);
            Assert.AreEqual(1, target.Characters.Count);
        }
示例#4
0
        public void ActCanRemoveScene()
        {
            var target = new Act();

            var scene1 = new Scene();
            var scene2 = new Scene();
            target.Add(scene1);
            target.Add(scene2);
            Assert.AreEqual(2, target.Scenes.Count);

            target.Remove(scene1);
            Assert.AreEqual(1, target.Scenes.Count);
        }
示例#5
0
        public void DirectionCanSetScene()
        {
            var target = new Direction();
            Assert.IsNull(target.Scene);

            var scene = new Scene();
            target.Scene = scene;
            Assert.AreEqual(scene, target.Scene);

            scene = new Scene();
            target.Scene = scene;
            Assert.AreEqual(scene, target.Scene);
        }
示例#6
0
文件: Act.cs 项目: ator/OpenCurtain
 public virtual void Remove(Scene scene)
 {
     scene.Act = null;
     Scenes.Remove(scene);
 }
示例#7
0
文件: Act.cs 项目: ator/OpenCurtain
 public virtual void Add(Scene scene)
 {
     scene.Act = this;
     Scenes.Add(scene);
 }