Exemplo n.º 1
0
    private void SetupMoveToTankSequence(Script_Sequence p_moveNearTankSequence)
    {
        Script_Action_SetFlag      setTankFlag  = new Script_Action_SetFlag(_behaviourTree, _manager.GetTank() as Script_IEntity, _entityToFollowFlag);
        Script_Action_UnoccupyTile unoccupyTile = new Script_Action_UnoccupyTile(_behaviourTree, _grid, _locationFlag);
        Script_Action_SetNearestLocationSurroundingEntity setLocationNearTank = new Script_Action_SetNearestLocationSurroundingEntity(_behaviourTree, _grid, _entityToFollowFlag, this as Script_IEntity, _locationFlag);
        Script_Action_OccupyTile     occupyTile     = new Script_Action_OccupyTile(_behaviourTree, _grid, _locationFlag);
        Script_Action_MoveToLocation moveToLocation = new Script_Action_MoveToLocation(_behaviourTree, this as Script_IEntity, _locationFlag);

        Script_Condition_IsEntityNull isTankNull = new Script_Condition_IsEntityNull(_behaviourTree, _entityToFollowFlag);

        Script_LeafTask setTankFlagLeaf         = new Script_LeafTask(_behaviourTree, setTankFlag);
        Script_LeafTask isTankNullLeaf          = new Script_LeafTask(_behaviourTree, isTankNull);
        Script_LeafTask unoccupyTileLeaf        = new Script_LeafTask(_behaviourTree, unoccupyTile);
        Script_LeafTask setLocationNearTankLeaf = new Script_LeafTask(_behaviourTree, setLocationNearTank);
        Script_LeafTask occupyTileLeaf          = new Script_LeafTask(_behaviourTree, occupyTile);
        Script_LeafTask moveToLocationLeaf      = new Script_LeafTask(_behaviourTree, moveToLocation);

        Script_Decorator_Inverter isTankNotNullDecorator = new Script_Decorator_Inverter(_behaviourTree, isTankNullLeaf);

        p_moveNearTankSequence.AddTask(setTankFlagLeaf);
        p_moveNearTankSequence.AddTask(isTankNotNullDecorator);
        p_moveNearTankSequence.AddTask(unoccupyTileLeaf);
        p_moveNearTankSequence.AddTask(setLocationNearTankLeaf);
        p_moveNearTankSequence.AddTask(occupyTileLeaf);
        p_moveNearTankSequence.AddTask(moveToLocationLeaf);
    }
Exemplo n.º 2
0
 public Script_Tank GetTank()
 {
     return(_manager.GetTank());
 }