Exemplo n.º 1
0
    public static Boolean PlaceShip(ShipModel ship, int[] pos)
    {
        int     indexToDefine = ship.GetLocationIndexToDefine();
        Boolean placed        = false;

        if (indexToDefine != -1)
        {
            if (ship.LocationIsValid(pos[0], pos[1]))
            {
                ship.Locations[indexToDefine] = pos;
                placed = true;
            }
        }

        return(placed);
    }