Beispiel #1
0
 public void AddObserver(ITetrisStateObserver observer)
 {
     if (!_observers.Contains(observer))
     {
         _observers.Add(observer);
     }
 }
Beispiel #2
0
 /*
  *      Removes a game state observer from the list of observers to notify.
  */
 public void RemoveStateObserver(ITetrisStateObserver observer)
 {
     _stateLogic.RemoveObserver(observer);
 }
Beispiel #3
0
 public void RemoveObserver(ITetrisStateObserver observer)
 {
     _observers.Remove(observer);
 }
Beispiel #4
0
 /*
  *      Enables an object to be updated of changes in game state.
  *      Attaching an observer is necessary for implementing a Tetris front-end since that is, for example,
  *      how updates to the game board are made accessible.
  *      Remember to call RemoveStateObserver if you want your observer to die before this tetris game dies.
  */
 public void AddStateObserver(ITetrisStateObserver observer)
 {
     _stateLogic.AddObserver(observer);
 }