Exemplo n.º 1
0
 public PlayerInformation(string name, byte hairVariant, Color hairColor, Color skinColor,
                          Color eyesColor, Color shirtColor, Color underShirtColor, Color pantsColor,
                          Color shoesColor, PlayerDifficulty difficulty)
 {
     if (name == null)
     {
         throw new ArgumentNullException("Name cannot be null.");
     }
     if (name.Length > 20)
     {
         throw new ArgumentException("Name length must be inferior or equal to 20 characters.");
     }
     _name            = name;
     _hairVariant     = hairVariant;
     _hairColor       = hairColor;
     _skinColor       = skinColor;
     _eyesColor       = eyesColor;
     _shirtColor      = shirtColor;
     _underShirtColor = underShirtColor;
     _pantsColor      = pantsColor;
     _shoesColor      = shoesColor;
     _difficulty      = difficulty;
     _health          = 100;
     _mana            = 20;
 }
 private void Awake()
 {
     Instance    = this;
     _difficulty = ShopDifficulty._difficulty;
 }
Exemplo n.º 3
0
        public static PlayerInformation GetRandomPlayer(string name, PlayerDifficulty difficulty)
        {
            Random r = new Random();

            return(new PlayerInformation(name, (byte)r.Next(0, 100), GetRandomColor(r), GetRandomColor(r), GetRandomColor(r), GetRandomColor(r), GetRandomColor(r), GetRandomColor(r), GetRandomColor(r), difficulty));
        }