Beispiel #1
0
        private void Save_Village(object sender, EventArgs e)
        {
            if (inputValidation.checkStringInput(village_name_label.Text))
            {
                MessageBox.Show(DefaultValue.saving_invalid_message);
                return;
            }

            game = gameFactory.getGame();
            IGameControlCommand onCommand      = commandFactory.GetGameControlCommand(DefaultValue.SAVE_KEY, game, village_name_label.Text, gameState);
            GameKeyInvoker      gameKeyInvoker = new GameKeyInvoker(onCommand);

            gameKeyInvoker.click();
        }
Beispiel #2
0
        private void Open_village(object sender, EventArgs e)
        {
            if (inputValidation.checkStringInput(selectedNationforOpening))
            {
                environment = environmentFactory.getEnvironment(Nation_Name, bangladesh_Nation_radioButton, egypt_nation_radioButton, arab_nation_radioButton, inuit_nation_radioButton, Tree, House, WaterSource, g, DefaultValue.DEFAULT_NATION, DefaultValue.DEFAULT_COLOR);
                environment.setEnvironment();
                MessageBox.Show(DefaultValue.opening_invalid_message);
                return;
            }
            game = gameFactory.getGame();

            IGameControlCommand onCommand      = commandFactory.GetGameControlCommand(DefaultValue.OPEN_KEY, game, village_name_label, selectedNationforOpening, g, pen);
            GameKeyInvoker      gameKeyInvoker = new GameKeyInvoker(onCommand);

            gameState = gameKeyInvoker.click();

            drawnItemsInfosList = gameState.DrawnItemsInformationList;

            selectedNationforOpening = "";
        }