Beispiel #1
0
        public static void Unregister(string groupName, TimeObject obj)
        {
            if (_controllers.TryGetValue(groupName, out var controller))
            {
                controller.RemoveObject(obj);
            }

            if (_registerCache.TryGetValue(groupName, out var list))
            {
                list.Remove(obj);
            }
        }
Beispiel #2
0
 public static void Register(string groupName, TimeObject obj)
 {
     if (_controllers.TryGetValue(groupName, out var controller))
     {
         controller.AddObject(obj);
     }
     else
     {
         List <TimeObject> list;
         if (!_registerCache.TryGetValue(groupName, out list))
         {
             list = new List <TimeObject>();
             _registerCache.Add(groupName, list);
         }
         list.Add(obj);
     }
 }
Beispiel #3
0
 public PauseState(TimeObject timeObject) : base(timeObject)
 {
 }
Beispiel #4
0
 public BackwardState(TimeObject timeObject) : base(timeObject)
 {
 }
Beispiel #5
0
 public ForwardState(TimeObject timeObject) : base(timeObject)
 {
 }
Beispiel #6
0
 public State(TimeObject timeObject)
 {
     _timeObject = timeObject;
 }
Beispiel #7
0
 public void RemoveObject(TimeObject obj)
 {
     obj.OnInvertableEventHandler -= OnInvertableEvent;
     _objects.Remove(obj);
 }
Beispiel #8
0
 public void AddObject(TimeObject obj)
 {
     obj.OnInvertableEventHandler += OnInvertableEvent;
     _objects.Add(obj);
     _currentState.OnAddObject(obj);
 }
Beispiel #9
0
 public override void OnAddObject(TimeObject obj)
 {
     obj.Pause();
 }
Beispiel #10
0
 public override void OnAddObject(TimeObject obj)
 {
     obj.Backward();
 }
Beispiel #11
0
 public abstract void OnAddObject(TimeObject obj);