示例#1
0
 public Weapon(string name, int damage, Magic magic)
 {
     if (string.IsNullOrEmpty(name))
     {
         throw new ArgumentException("Weapon must have a name");
     }
     if (damage < 0)
     {
         throw new ArgumentException("Weapon must have positive damage");
     }
     this.name = name;
     this.damage = damage;
     this.magic = magic;
 }
示例#2
0
 public void changeMagic(Magic magic)
 {
     this.magic = magic;
 }
示例#3
0
 public void changeMagic(Magic magic)
 {
     this.magic = magic;
 }