Esempio n. 1
0
    public List <Vector2Int> getMoveLocationsInLayerInMid(Piece piece, Vector2Int startGridPoint, Vector2Int midGridPoint)
    {
        if (piece == null || getPieceAtGrid(startGridPoint) == null)
        {
            return(new List <Vector2Int>());
        }

        List <Vector2Int> allowedGridsInLayerInMid = getMoveLocationsInLayer(piece, midGridPoint, true);

        Commn.AddLocation(midGridPoint, allowedGridsInLayerInMid);

        return(allowedGridsInLayerInMid);
    }
Esempio n. 2
0
    public List <Vector2Int> getMoveLocations(Vector2Int startPoint, Vector2Int midPoint)
    {
        Piece             piece        = getPieceAtGrid(startPoint);
        List <Vector2Int> allowedGrids = new List <Vector2Int>();

        foreach (Layer layer in layers)
        {
            List <Vector2Int> allowedGridsInLayer = layer.getMoveLocationsInLayerInMid(piece, startPoint, midPoint);
            for (int j = 0; j < allowedGridsInLayer.Count; j++)
            {
                Commn.AddLocation(allowedGridsInLayer[j], allowedGrids);
            }
        }

        return(allowedGrids);
    }
Esempio n. 3
0
    // ============================================[LOCATIONS]
    public List <Vector2Int> getMoveLocations(Vector2Int gridPoint, bool isQuant)
    {
        Piece             piece        = getPieceAtGrid(gridPoint);
        List <Vector2Int> allowedGrids = new List <Vector2Int>();

        foreach (Layer layer in layers)
        {
            List <Vector2Int> allowedGridsInLayer = layer.getMoveLocationsInLayerInStep(piece, gridPoint, isQuant);
            for (int j = 0; j < allowedGridsInLayer.Count; j++)
            {
                Commn.AddLocation(allowedGridsInLayer[j], allowedGrids);
            }
        }

        return(allowedGrids);
    }