Пример #1
0
        public static IBehaviorTreeNode WithFightingAI(IBehaviorTreeNode tree, MovingEntity entity)
        {
            BehaviorTreeBuilder builder = new BehaviorTreeBuilder(((RootNode)tree).TickFrequency);

            return(builder
                   .Selector()
                   .LongRunning(() => new FightTask(entity))
                   .Sequence()
                   .SingleStepResultCached((GameTime gameTime) =>
            {
                entity.StopWalking();

                return BehaviourTreeStatus.Success;
            })
                   .Splice(tree)
                   .End()
                   .End()
                   .Build());
        }