public IGameDisplay GetGameDisplay(Logic.Game game)
        {
            var game_game_object = new GameObject("Game");
            var game_display     = game_game_object.AddComponent <GameDisplay>();

            return(game_display);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Patron"] == null) Response.Redirect("/");
            var patron = (Patron)Session["Patron"];

            var gameLogic = new Logic.Game();
            this.gamemapNav.Visible = !string.IsNullOrEmpty(gameLogic.GetGameboardPath(patron));
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Patron"] == null)
            {
                Response.Redirect("/");
            }
            var patron = (Patron)Session["Patron"];

            var gameLogic = new Logic.Game();

            this.gamemapNav.Visible = !string.IsNullOrEmpty(gameLogic.GetGameboardPath(patron));
        }
Example #4
0
        private void startButton_Click(object sender, EventArgs e)
        {
            var game = new Logic.Game("player1", HasBot.Checked ? comboBoxBotNames.Text : "player2");

            //maak bot met gegevens er hoeft voor de rest niks mee gedaan worden alles wordt intern afgehandeld
            if (HasBot.Checked)
            {
                factory.CreatBot(comboBoxBotNames.Text, game.Board, game.Players[1]);
            }

            Form f = new MainForm(game);

            f.Show();
        }
Example #5
0
        public Game(GamesEnum games, MainViewModel mainViewModel)
        {
            this.mainViewModel = mainViewModel;
            this.GetGamesEnum  = games;
            if (games == GamesEnum.Dice)
            {
                GameViewModel = new DiceViewModel(this);
                LogicGame     = new Logic.Dice(GameViewModel);
                page          = new Pages.Dice(GameViewModel as DiceViewModel);
            }
            else if (games == GamesEnum.Lottery)
            {
                GameViewModel = new LotteryViewModel(this);
                LogicGame     = new Logic.Lottery(GameViewModel);
                page          = new Pages.Lottery(GameViewModel as LotteryViewModel);
            }

            GameButton.Content         = LogicGame.Name;
            GameButton.Command         = new Command((obj) => { mainViewModel.ActuallyBody = page; });
            mainViewModel.ActuallyBody = page;
            mainViewModel.AddButtons(GameButton);
        }