コード例 #1
0
 public WoodsyGameData(List <String> inputParticipantIds)
 {
     // Constructor: create a Woodsy game data structure based on the supplied player ID's.
     this.lastErrorMessage = "";
     this.participantIds.Clear();
     this.remainingHouses.Clear();
     this.remainingPersons.Clear();
     this.personScores = new int[Pieces.numberOfPeople()];
     this.personScoresAtStartOfTurn = new int[Pieces.numberOfPeople()];
     for (int i = 1; i <= Pieces.numberOfPeople(); i++)
     {
         this.remainingHouses.Add(Pieces.createHousePiece(i));
         this.remainingPersons.Add(Pieces.createPersonPiece(i));
         this.personScores[i - 1] = this.maxPointsForGoal();
     }
     this.piecesToPlay.Clear();
     this.boards.Clear();
     this.scores.Clear();
     //
     //  prepare the piece bag
     this.pieceBag      = Pieces.pieces();
     this.minPiecesLeft = this.pieceBag.Length;
     //
     //  now, add all the known  participants.
     //
     foreach (String thisParticipantId in inputParticipantIds)
     {
         if (thisParticipantId != null)
         {
             this.addParticipantIfNeeded(thisParticipantId);
         }
     }
 }