// Resets the instance and returns the player whose turn it is.
        public int StartGame(int num_players)
        {
            instance = new GameController();
            instance.currentPlayer = 0;
            instance.number_of_players = num_players;
            instance.scores = new int[number_of_players];
            instance.Activity = new bool[number_of_players];

            for (int i = 0; i < num_players; i ++)
            {
                scores[i] = 0;
                Activity[i] = true;
            }

            return instance.GetCurrentPlayer();
        }
Exemple #2
0
        private void GetFighterType()
        {
            grpController.Enabled = false;

            _invokerGameController = new GameController();

            FighterFactory newFactory = new FighterFactory();
            _fighter = newFactory.CreateFighter(cboFighterType.Text);

            labelEnergy.DataBindings.Clear();
            labelEnergy.DataBindings.Add(new Binding("Text", _fighter, "Energy"));

            labelLocation.DataBindings.Clear();
            labelLocation.DataBindings.Add(new Binding("Text", _fighter, "Location"));

            labelDamage.DataBindings.Clear();
            labelDamage.DataBindings.Add(new Binding("Text", _fighter, "InflictedDamage"));

            labelUndoItems1.DataBindings.Clear();
            labelUndoItems1.DataBindings.Add(new Binding("Text", _invokerGameController, "UndoStackCount"));

            labelRedoItems1.DataBindings.Clear();
            labelRedoItems1.DataBindings.Add(new Binding("Text", _invokerGameController, "RedoStackCount"));

            grpController.Enabled = true;
        }