Esempio n. 1
0
 public IEnumerable<CharacterType> GetCharacters(int count)
 {
     CharacterType[] characters = new CharacterType[count];
     CharacterType character;
     bool checkConflict = false;
     for(int i = 0; i < count; i++)
     {
         do
             character = remainingCharacters.GetRandom();
         while(checkConflict && characters.Contains(character));
         remainingCharacters.Remove(character);
         if(remainingCharacters.Count == 0)
         {
             remainingCharacters = Utils.GetCharacterTypes(this);
             checkConflict = true;
         }
         characters[i] = character;
     }
     return characters;
 }