示例#1
0
 public void GameObjectAddRemove()
 {
     var ls = new Bunch();
     var ss = new StarShip();
     ls.Execute(Bunch.Cmd.Add, ss);
     Assert.IsTrue(ls.Contains(ss));
     Assert.IsTrue(ss.Owner != ls);
     ls.Execute(Bunch.Cmd.Remove, ss);
     Assert.IsTrue(!ls.Contains(ss));
     Assert.IsTrue(ss.Owner != ls);
 }
示例#2
0
 public void LocalSystemWipeoffWithNoOwnedObj()
 {
     var ls = new Bunch();
     var dls = ls.AsDynamic;
     var ss = new StarShip { IsActive = true };
     var check = 0;
     ls.Add(ss);
     ls.Commands[GameObject.Cmd.WipeOff].ExecuteHnd += (obj, mnemoCode, args) => check++;
     ss.Commands[GameObject.Cmd.WipeOff].ExecuteHnd += (obj, mnemoCode, args) => check += 2;
     dls.WipeOff();
     Assert.AreEqual(check, 1);
     Assert.IsTrue(ss.IsActive);
 }