Exemple #1
0
        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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 private void AddRandom_Click(object sender, RoutedEventArgs e) => portControl?.AddBoat(HarborHelper.GetRandomBoat().boat);