Beispiel #1
0
    /**
     * @Description est appellée par un controlleur pour changer de round
     * On procède en deux étapes.
     *  - D'abord, pour chaque cellule on évalue ce que sera son état à la
     *    prochaine génération.
     *  - Ensuite, on applique les évolutions qui ont été calculées.
     */
    public void nextRound()
    {
        for (int i = 0; i < numberCardToPick; i++) // on pioche un certain nombre de carte
        {
            if (tasCarteInnondation.Count + defausseCarteInnondation.Count > 0)
            {
                if (tasCarteInnondation.Count == 0)           //si tas vide on remet la defausse dans le tas
                {
                    Island.Shuffle(defausseCarteInnondation); //on melange avant
                    tasCarteInnondation.AddRange(defausseCarteInnondation);
                    defausseCarteInnondation.Clear();
                }
                Zone          z    = tasCarteInnondation[0]; // on pioche la carte ( mise à jour de la zone )
                Etat.EtatName etat = z.getEtat();
                z.setEtat(Etat.nextEtat(etat));
                if (z.getEtat() != Etat.EtatName.Submergee)
                {
                    defausseCarteInnondation.Add(z); // defausse la carte
                }
                tasCarteInnondation.Remove(z);       // on retire la carte
            }
        }


        RoundOf.searchKey(this.tasCarteTresor, this.defausseCarteTresor, this);
        //RoundOf.searchKey(this.tasCarteTresor, this.defausseCarteTresor, this);

        //displayLose();

        /*listArtefacts.add(Artefacts.eau);
        *  listArtefacts.add(Artefacts.eau);
        *  listArtefacts.add(Artefacts.feu);
        *  listArtefacts.add(Artefacts.air);*/

        //mise à jour du prochain joueur
        List <Player> players = this.listPlayers;

        this.setRoundOf(players[(players.IndexOf(this.getRoundOf()) + 1) % players.Count]);

        //notifyObservers();
    }