Esempio n. 1
0
 private void UserForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!(ShipChanged?.Invoke(new Ship()) ?? false))
     {
         e.Cancel = true;
     }
 }
 protected void OnShipChanged(Ship shipUpdated, bool killed)
 {
     ShipChanged?.Invoke(this, new ShipChangedEventArgs(shipUpdated, killed));
 }
Esempio n. 3
0
 private void btnBoat_Click(object sender, EventArgs e) =>
 ShipChanged?.Invoke(new Ship(ShipType.Boat, ShipOrientation.Vertical & ShipOrientation.Horizontal));
Esempio n. 4
0
 private void btnDestroyerVertical_Click(object sender, EventArgs e) =>
 ShipChanged?.Invoke(new Ship(ShipType.Destroyer, ShipOrientation.Vertical));
Esempio n. 5
0
 private void btnCruiserHorizontal_Click(object sender, EventArgs e) =>
 ShipChanged?.Invoke(new Ship(ShipType.Cruiser, ShipOrientation.Horizontal));
Esempio n. 6
0
 private void btnBattleshipVertical_Click(object sender, EventArgs e) =>
 ShipChanged?.Invoke(new Ship(ShipType.Battleship, ShipOrientation.Vertical));