/// <summary> /// creates a TOTALAMOUNTOFSHIPS of THISTYPE and ADDS THEM TO THE RESULT /// </summary> private static void CreateShips(List <Ship> result, int totalAmountOfShips, Shiptype thisType) { for (int i = 0; i < totalAmountOfShips; i++) { result.Add(new Ship()); } }
private void Ship_Checked(object sender, RoutedEventArgs e) { RadioButton rb = sender as RadioButton; if (rb != null) { string shipname = rb.Tag.ToString(); switch (shipname) { case "Carrier": slcShip = Shiptype.Carrier; break; case "Cruiser": slcShip = Shiptype.Cruiser; break; case "Battleship": slcShip = Shiptype.Battleship; break; case "Submarine": slcShip = Shiptype.Submarine; break; case "Destroyer": slcShip = Shiptype.Destroyer; break; } } }
private Ship CreateNewShip(Shiptype typeOfNewShip, Size renderSize) { Ship result = new Ship(); double renderedWidth = renderSize.Width / 11 * Grid.GetColumnSpan(result); double renderedHeight = renderSize.Height / 11 * Grid.GetRowSpan(result); result.Width = renderedWidth; result.Height = renderedHeight; return(result); }
public UIShipType(Shiptype type, DateTime time, bool refresh) : base(UITypeEnum.ShipType, time, refresh) { ShipType = type; }
public UIShipType(Shiptype type, DateTime time) : base(UITypeEnum.ShipType, time) { ShipType = type; }
public UIShipType(Shiptype type, DateTime time, bool refresh) : this(time, refresh) { ShipType = type; }