Ejemplo n.º 1
0
    public bool canMove(HexCoordinate hex1, HexCoordinate hex2)
    { //return if the two tiles are adjacent and have doors in the correct spots for movement
        BoardTile b1 = _map[hex1];
        BoardTile b2 = _map[hex2];

        if (isNeighbor(hex1, hex2))
        {
            Vector2Int offset = hex2 - hex1;
            int        dir    = (int)HexCoordinate.GetDirectionFromOffset(offset);

            return(b2.doors[dir] && b1.doors[(int)HexCoordinate.inverseDirection[dir]]);
        }
        else
        {
            return(false);
        }
    }