public void MoveShip() { foreach (Ship ship in _ShipList.ToList()) { Direction richting = ship.WayToMove(); if (richting != Direction.Still) { if (richting.Equals(Direction.Remove)) { _ShipList.Remove(ship); ShipEnd.ToChar1 = '█'; Water Tile1 = (Water)ShipEnd.TileToRight; Tile1.ToChar1 = '█'; Tile1.Remove(); Water Tile2 = (Water)ShipEnd.TileToRight.TileToRight; Tile2.ToChar1 = '█'; Tile2.Remove(); Water Tile3 = (Water)ShipEnd.TileToRight.TileToRight.TileToRight; Tile3.ToChar1 = '█'; Tile3.Remove(); TotalScore += 10; } else { ship.MakeMove(richting); } } } }
public void moveShip() { foreach (Ship ship in shipList.ToList()) { Direction richting = ship.WayToMove(); if (richting != Direction.nulldirection) { if (richting.Equals(Direction.Remove)) { shipList.Remove(ship); ShipEnd.ToChar1 = '█'; Water field1 = (Water)ShipEnd.FieldToRight; field1.ToChar1 = '█'; field1.Remove(); Water field2 = (Water)ShipEnd.FieldToRight.FieldToRight; field2.ToChar1 = '█'; field2.Remove(); Water field3 = (Water)ShipEnd.FieldToRight.FieldToRight.FieldToRight; field3.ToChar1 = '█'; field3.Remove(); TotalScore += 10; } else { ship.MakeMove(richting); } } } }