Exemplo n.º 1
0
        static void Main()
        {
            string        name        = getName();
            uint          statistical = getStats(name);
            Weapon        weapon      = new Weapon();
            Head          head        = new Head();
            Torso         torso       = new Torso();
            Legs          legs        = new Legs();
            MainCharacter player      = new MainCharacter(hp: statistics[statistical, 0], level: 1, attack: statistics[statistical, 1],
                                                          defense: statistics[statistical, 2], speed: statistics[statistical, 3], name: name, weapon: weapon,
                                                          head: head, torso: torso, legs: legs);

            Console.WriteLine(player.head.name);
        }
Exemplo n.º 2
0
 public MainCharacter(uint hp, uint level, uint attack, uint defense, uint speed, string name,
                      Weapon weapon, Head head, Torso torso, Legs legs)
 {
     this.hp           = hp;
     this.xp           = 0;
     this.level        = level;
     this.attack       = attack;
     this.defense      = defense;
     this.speed        = speed;
     this.name         = name;
     this.totalAttack  = attack + weapon.attack;
     this.weapon       = weapon;
     this.head         = head;
     this.torso        = torso;
     this.legs         = legs;
     this.totalDefense = defense + head.defense + torso.defense + legs.defense;
 }