コード例 #1
0
 public bool RemoveBehavior(CoreBehavior behavior)
 {
     // Remove behavior from list of CoreBehaviors if behavior is not null && does not already exist in the list.
     if (behavior != null && ActiveBehaviors.FirstOrDefault(obj => obj == behavior) != null)
     {
         ActiveBehaviors.Remove(behavior);
         return(true);
     }
     return(false);
 }
コード例 #2
0
 public bool AddBehavior(CoreBehavior behavior)
 {
     // Add behavior to list of CoreBehaviors if behavior is not null && does not already exist in the list.
     if (behavior != null && ActiveBehaviors.FirstOrDefault(obj => obj == behavior) == null)
     {
         ActiveBehaviors.Add(behavior);
         return(true);
     }
     return(false);
 }