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