Ejemplo n.º 1
0
        private void IntroduceGameMechanics()
        {
            this.iterator = this.participants.CreateIterator();

            this.turnManager   = new TurnManager(iterator, this.participants.Referee);
            this.gameMechanism = new GameMechanism(this.turnManager);

            for (int i = 0; i < participants.Count; i++)
            {
                this.gameMechanism.AddPlayer(participants[i]);
            }
        }
Ejemplo n.º 2
0
        public void IntroduceGameMechanicsToPlayers(GameMechanism gameMechanism)
        {
            this.observer = gameMechanism;

            for (int i = 0; i < this.iterator.NumberOfParticipants; i++)
            {
                iterator.StartingPlayer.ExplainGameMechanics(gameMechanism);

                List <ITableObserver> observers = new List <ITableObserver>(); // sve ostale igrače osim trenutnog u stavljam u listu

                for (int j = 0; j < this.iterator.NumberOfParticipants; j++)
                {
                    Player current = this.iterator.CurrentPlayer;

                    if (j != 0)
                    {
                        observers.Add(current);
                    }
                }
                iterator.CurrentPlayer.GreetOtherPlayers(observers);
            }
        }