コード例 #1
0
ファイル: Item.cs プロジェクト: jesconsa/Telerik-Academy
        protected Item(string name, int itemValue, string type, Location location = null)
            : base(name)
        {
            this.Value = itemValue;

            foreach (var itemType in (ItemType[])Enum.GetValues(typeof(ItemType)))
            {
                if (itemType.ToString() == type)
                {
                    this.ItemType = itemType;
                }
            }
        }
コード例 #2
0
ファイル: Armor.cs プロジェクト: jesconsa/Telerik-Academy
 public Armor(string name, Location location = null)
     : base(name, Armor.GeneralArmorValue, ItemType.Armor, location)
 {
 }
コード例 #3
0
ファイル: Weapon.cs プロジェクト: jesconsa/Telerik-Academy
 public Weapon(string name, Location location = null)
     : base(name, Weapon.MoneyValue, ItemType.Weapon, location)
 {
 }
コード例 #4
0
ファイル: Wood.cs プロジェクト: jesconsa/Telerik-Academy
 public Wood(string name, Location location = null)
     : base(name, Wood.MoneyValue, ItemType.Wood, location)
 {
 }
コード例 #5
0
ファイル: Item.cs プロジェクト: jesconsa/Telerik-Academy
 protected Item(string name, int itemValue, ItemType type, Location location = null)
     : base(name)
 {
     this.Value = itemValue;
     this.ItemType = type;
 }