示例#1
0
        public bool UndesignateRoomBehavior(RoomBehavior roomBehavior)
        {
            // Just uninstalling.
            if (RoomBehaviors == null)
            {
                return(false);
            }

            RoomBehaviors.Remove(roomBehavior.Type);

            return(true);
        }
示例#2
0
        public bool DesignateRoomBehavior(RoomBehavior objInstance)
        {
            if (objInstance == null)
            {
                return(false);
            }

            if (RoomBehaviors.ContainsKey(objInstance.Type))
            {
                return(false);
            }

            if (objInstance.IsValidRoom(this) == false)
            {
                UnityDebugger.Debugger.LogError("Tile", "Trying to assign a RoomBehavior to a room that isn't valid!");
                return(false);
            }

            objInstance.Control(this);

            RoomBehaviors.Add(objInstance.Type, objInstance);

            return(true);
        }
示例#3
0
 public bool HasRoomBehavior(string behaviorKey)
 {
     return(RoomBehaviors.ContainsKey(behaviorKey));
 }