首页 > 代码库 > S2T40,第四章,简答5

S2T40,第四章,简答5

技术分享
 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using System.Threading.Tasks;
 6 
 7 namespace Emmet
 8 {
 9     class Wizard
10     {
11         public Wizard()
12         {
13             this.HP = 1000;
14         }
15 
16         public Wizard(int level, int combatValues, int hp)
17         {
18             this.HP = hp;
19             this.Level = level;
20             this.CombatValues = combatValues;
21         }
22 
23         public int Level { get; set; }
24 
25         public int CombatValues { get; set; }
26 
27         public int HP { get; set; }
28     }
29 }
巫师类的重载构造函数

 

S2T40,第四章,简答5