Example #1
0
 // Adds a behavior to the item.
 public void TriggerBehavior(ItemBehaviorType behavior)
 {
     if (HasBehavior(behavior))
     {
         behaviors[behavior].Execute();
     }
 }
Example #2
0
 public IItemBehavior GetBehavior(ItemBehaviorType behavior)
 {
     if (behaviors.ContainsKey(behavior))
     {
         return(behaviors[behavior]);
     }
     else
     {
         return(null);
     }
 }
Example #3
0
 // Returns true of the behavior is present. False otherwise.
 public bool HasBehavior(ItemBehaviorType type)
 {
     return(behaviors.ContainsKey(type));
 }