Esempio n. 1
0
        public static bool isPositionReachable(this Vector vec)
        {
            Hex hexPos = vec.ConvertHex();

            if (!hexPos.isInBound())
            {
                return(false);
            }

            if (Mine.minePos.Contains(hexPos))
            {
                return(false);
            }

            foreach (var ship in Ship.ships.Values)
            {
                if (ship.isAlive &&
                    (hexPos == ship.hexPos ||
                     vec == ship.currentPositionInfo.shipFront ||
                     vec == ship.currentPositionInfo.shipBack))
                {
                    return(false);
                }
            }

            return(true);
        }