Example #1
0
        public static void Test()
        {
            StateObject stateObject1 = new StateObject("Object1");
            StateObject stateObject2 = new StateObject("Object2");

            stateObject1.AnotherObject = stateObject2;
            stateObject2.AnotherObject = stateObject1;

            NotifyManager.AddNotifyReciever(stateObject1);
            NotifyManager.AddNotifyReciever(stateObject2);

            while (true)
            {
                stateObject1.Update(1);
                stateObject2.Update(1);

                NotifyManager.Update(1);
                Thread.Sleep(1000);
            }
        }
Example #2
0
 public override void Execute(double elapsedSeconds)
 {
     Console.WriteLine("{0} Attacking {1}", Object.Name, Object.AnotherObject.Name);
     NotifyManager.Notify(new AttackNotification(Object.AnotherObject, Object));
     Object.LifeTime = 0;
 }