protected void AddBehavior(params IBehavior[] someBehaviors) { CheckArg.BehaviorParam(someBehaviors); var behaviors = new Behaviors(); foreach (var item in someBehaviors) { behaviors.AddBehavior(item); fListBehaviors.Add(item); } behaviors.LinkToActor(this); AddMissedMessages(); TrySetInTask(); }
protected void Become(params IBehavior[] manyBehaviors) { CheckArg.BehaviorParam(manyBehaviors); fListBehaviors.Clear(); var someBehaviors = new Behaviors(); foreach (var item in manyBehaviors) { someBehaviors.AddBehavior(item); fListBehaviors.Add(item); } someBehaviors.LinkToActor(this); AddMissedMessages(); TrySetInTask(); }