示例#1
0
        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();
        }
示例#2
0
        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();
        }