Ejemplo n.º 1
0
 public Action <IRoom> this[RoomEventType eventType]
 {
     get
     {
         return(_actions[eventType]);
     }
 }
Ejemplo n.º 2
0
 private void FillDictionary(RoomEventType eventType, Command[] array)
 {
     foreach (var command in array)
     {
         _dictionary[eventType] += (room) => command.Execute(gameObject);
     }
 }
Ejemplo n.º 3
0
    public Action <IRoom> this[RoomEventType eventType]
    {
        get
        {
            if (isActiveAndEnabled)
            {
                if (_actions == null)
                {
                    _actions = new EnumActionDictionary <RoomEventType, IRoom>();
                    foreach (var listener in _roomEventsListeners.GetCachedComponets <IRoomEventListener>())
                    {
                        foreach (var roomEvent in StructsExtentions.GetEnumValues <RoomEventType>())
                        {
                            if (listener[roomEvent] != null)
                            {
                                _actions[roomEvent] += listener[roomEvent];
                            }
                        }
                    }
                }

                return(_actions[eventType]);
            }
            return(null);
        }
    }
Ejemplo n.º 4
0
 public Action <IRoom> this[RoomEventType eventType]
 {
     get
     {
         CreateDictionary();
         return(_dictionary[eventType]);
     }
 }
Ejemplo n.º 5
0
 public static void RoomAction(string roomName, RoomEventType type, int itemCount, int totalItemCount)
 {
     if (OnRoomAction != null) {
         OnRoomAction (roomName, type, itemCount, totalItemCount);
     }
 }
Ejemplo n.º 6
0
 public RoomEvent(DateTime date, RoomEventType type, string description)
 {
     Date = date;
     Type = type;
     Description = description;
 }