Beispiel #1
0
 //Might change String to an int later
 public void notifyObservers(Constants.GAME_UPDATE message, Object data)
 {
     foreach (Observer o in observers)
     {
         o.receiveUpdate(message, data);
     }
 }
Beispiel #2
0
        public void receiveUpdate(Constants.GAME_UPDATE message, Object data)
        {
            switch (message)
            {
                case Constants.GAME_UPDATE.Capture:
                    break;

                default:
                    break;

            }
        }
Beispiel #3
0
        public void receiveUpdate(Constants.GAME_UPDATE message, Object data)
        {
            switch (message)
            {
                case Constants.GAME_UPDATE.Capture:
                    Tuple<TileObject, TileObject> bundle = data as Tuple<TileObject, TileObject>;
                    if (bundle._item2.Equals(this))
                    {
                        _location = new Point();
                        _current = null;
                    }
                    break;

                default:
                    break;

            }
        }
Beispiel #4
0
        public void receiveUpdate(Constants.GAME_UPDATE message, Object data)
        {
            switch (message)
            {
                case Constants.GAME_UPDATE.Capture:
                    Tuple<TileObject, TileObject> bundle = data as Tuple<TileObject, TileObject>;
                    if (bundle._item1.GetType() == typeof(Player) && bundle._item1.Equals(this))
                    {
                        if (bundle._item2.GetType() == typeof(Enemy))
                        {
                            prisoners.Add((Enemy)bundle._item2);
                        }
                        else
                        {
                            collectedItems.Add(bundle._item2);
                        }
                    }
                    break;

                default:
                    break;

            }
        }
Beispiel #5
0
 public void notifyObservers(Constants.GAME_UPDATE message, Object data)
 {
     if (data == null)
     {
         return;
     }
     foreach (TileObject observer in _observers)
     {
         observer.receiveUpdate(message, data);
     }
 }