/// <summary>Places a plane during setup</summary> /// <param name="NewPlane">The plane to be place.</param> /// <returns>A bool indicating if the plane was successfully placed</returns> public bool AddPlane(Plane.Plane NewPlane) { if (CanPlaceFPlane(NewPlane)) { FPlanes.Add(NewPlane); return(true); } return(false); }
/// <summary>Checks if the player can place a plane during setup</summary> /// <param name="NewPlane">The plane to be place.</param> /// <returns>A bool indicating if the plane can be placed</returns> public bool CanPlaceFPlane(Plane.Plane NewPlane) { foreach (Ship.Ship i in Ships) { if (i.CanHoldPlaneAt(NewPlane.Location)) { foreach (Plane.Plane j in FPlanes) { if (NewPlane.TileConflict(j)) { return(false); } } return(true); } } return(false); }