private static IBehaviour <BtContext> BuildHouseBehaviour()
        {
            const int requiredStones = 2;
            const int requiredWood   = 4;

            var gatherRequiredResources = FluentBuilder.FluentBuilder.Create <BtContext>()
                                          .Sequence("Gather resources")
                                          .Selector("Gather wood")
                                          .Condition("Has enough wood?", c => BotBehaviourFunctions.HasItem(c, ItemTypes.Wood, requiredWood))
                                          .Subtree(ChopWoodBehaviour())
                                          .End()
                                          .Selector("Gather stone")
                                          .Condition("Has enough stone?", c => BotBehaviourFunctions.HasItem(c, ItemTypes.Stone, requiredStones))
                                          .Subtree(MineStoneBehaviour())
                                          .End()
                                          .End()
                                          .Build();

            return(FluentBuilder.FluentBuilder.Create <BtContext>()
                   .PrioritySequence("Build house")
                   .Subtree(gatherRequiredResources)
                   .Do("Spawn house", c => BotBehaviourFunctions.BuildHouse(c, requiredStones, requiredWood))
                   .End()
                   .Build());
        }
 private static IBehaviour <BtContext> ChopWoodBehaviour()
 {
     return(FluentBuilder.FluentBuilder.Create <BtContext>()
            .PrioritySequence("Chop wood")
            .Selector("Get axe")
            .Condition("Has axe?", c => BotBehaviourFunctions.HasItem(c, ItemTypes.Axe, 1))
            .Subtree(FindAndPickupItem(ItemTypes.Axe))
            .End()
            .Subtree(FindAndPickupItem(ItemTypes.Wood))
            .End()
            .Build());
 }
 private static IBehaviour <BtContext> MineStoneBehaviour()
 {
     return(FluentBuilder.FluentBuilder.Create <BtContext>()
            .PrioritySequence("Mine stone")
            .Selector("Get pickaxe")
            .Condition("Has pickaxe?", c => BotBehaviourFunctions.HasItem(c, ItemTypes.Pickaxe, 1))
            .Subtree(FindAndPickupItem(ItemTypes.Pickaxe))
            .End()
            .Subtree(FindAndPickupItem(ItemTypes.Stone))
            .End()
            .Build());
 }