private void TypeCombo_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { var type = HarborHelper.RegisteredBoatTypes[(string)TypeCombo.SelectedValue]; (_, template) = HarborHelper.GetRandomBoat(type); PrefixChar.Text = template.IdentityCode.First().ToString(); PrefixLine.Visibility = Visibility.Visible; UniqueLabel.Text = template.Characteristic; }
private static void ConsoleCommand() { bool inMenu = true; do { if (KeyAvailable) { switch (ReadKey(true).Key) { case ConsoleKey.Escape: inMenu = false; break; case ConsoleKey.W: LoadWindow(); return; case ConsoleKey.R: portControl.AddBoat(HarborHelper.GetRandomBoat().boat); PortMenu(); break; case ConsoleKey.D: portControl.IncrementTime(); PortMenu(); break; case ConsoleKey.S: portControl.SavePortData(); break; case ConsoleKey.L: portControl.LoadPortData(); PortMenu(); break; case ConsoleKey.C: portControl.ResetPort(); PortMenu(); break; } } } while (inMenu); }
private void AddRandom_Click(object sender, RoutedEventArgs e) => portControl?.AddBoat(HarborHelper.GetRandomBoat().boat);