Ejemplo n.º 1
0
    public override void DefineTargets()
    {
        BattleHex    initialHex = GetComponentInParent <BattleHex>(); //hex occupied by the troll
        IEvaluateHex checkHex   = new IfItIsTarget();                 //neighboring hexes validation rule

        //collect potencial targets
        List <BattleHex> neighboursToCheck = NeighboursFinder.GetAdjacentHexes(initialHex, checkHex);

        if (neighboursToCheck.Count > 0) //if there is a target on the adjacent hex
        {
            HeroIsAtacking();            //attacks the target
        }
        else
        {
            turn.TurnIsCompleted();
        }                               //turn is completed
    }
Ejemplo n.º 2
0
    public override void DefineTargets()
    {
        BattleHex    initialHex = GetComponentInParent <BattleHex>(); // hex ocupado por el troll
        IEvaluateHex checkHex   = new IfItIsTarget();                 // regla de validación de hexes vecinos

        // recopilar objetivos potenciales
        List <BattleHex> neighboursToCheck = NeighboursFinder.GetAdjacentHexes(initialHex, checkHex);

        if (neighboursToCheck.Count > 0) // si hay un objetivo en el hex adyacente
        {
            HeroIsAtacking();            // ataca al objetivo
        }
        else
        {
            turn.TurnIsCompleted();
        }                               // se completa el turno
    }