예제 #1
0
파일: Item.cs 프로젝트: JacobGrealy/GetAway
 // Adds a behavior to the item.
 public void TriggerBehavior(ItemBehaviorType behavior)
 {
     if (HasBehavior(behavior))
     {
         behaviors[behavior].Execute();
     }
 }
예제 #2
0
파일: Item.cs 프로젝트: JacobGrealy/GetAway
 public IItemBehavior GetBehavior(ItemBehaviorType behavior)
 {
     if (behaviors.ContainsKey(behavior))
     {
         return(behaviors[behavior]);
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
파일: Item.cs 프로젝트: JacobGrealy/GetAway
 // Returns true of the behavior is present. False otherwise.
 public bool HasBehavior(ItemBehaviorType type)
 {
     return(behaviors.ContainsKey(type));
 }