当前位置: 首页>>代码示例>>C#>>正文


C# Armor类代码示例

本文整理汇总了C#中Armor的典型用法代码示例。如果您正苦于以下问题:C# Armor类的具体用法?C# Armor怎么用?C# Armor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Armor类属于命名空间,在下文中一共展示了Armor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddArmor

 public void AddArmor(string id)
 {
     Armor x = new Armor();
     x.ID = id;
     x.Description = "An Armor Set";
     Armors.Add(x);
 }
开发者ID:charblaze,项目名称:SoulSynthusResonance,代码行数:7,代码来源:PlayerInventory.cs

示例2: Armor

 public Armor(Armor armor)
     : base(armor)
 {
     this.armorValue = armor.ArmorValue;
     this.exterieur = armor.exterieur;
     this.interieur = armor.interieur;
 }
开发者ID:JMounier,项目名称:Aegina,代码行数:7,代码来源:Armor.cs

示例3: ArmorEqualsAndHashCode

        public void ArmorEqualsAndHashCode()
        {
            Armor armor = new Armor(ArmorType.Unarmored, 5);

            //Using IsTrue/IsFalse to cover all paths (aren't covered, when using Equals)
            //Equal tests
            Assert.IsTrue(armor.Equals(armor));
            Assert.AreEqual(armor.GetHashCode(), armor.GetHashCode());

            object equal = new Armor(ArmorType.Unarmored, 5);
            Assert.IsTrue(armor.Equals(equal));
            Assert.AreEqual(equal.GetHashCode(), armor.GetHashCode());

            //Not equal tests
            Assert.IsFalse(armor.Equals(null));

            object notEqual = new object();
            Assert.IsFalse(armor.Equals(notEqual));
            Assert.AreNotEqual(notEqual.GetHashCode(), armor.GetHashCode());

            notEqual = new Armor(ArmorType.Medium, 5);
            Assert.IsFalse(armor.Equals(notEqual));
            Assert.AreNotEqual(notEqual.GetHashCode(), armor.GetHashCode());

            notEqual = new Armor(ArmorType.Unarmored, 3);
            Assert.IsFalse(armor.Equals(notEqual));
            Assert.AreNotEqual(notEqual.GetHashCode(), armor.GetHashCode());
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:28,代码来源:TestArmor.cs

示例4: changeArmor

 void changeArmor(Armor armor)
 {
     if(armorSwitcher != null){
         armorSwitcher.changeAnimationLayer(armor.armorAnimationLayerName);
         armorSwitcher.switchArm(armor.armSprite);
     }
 }
开发者ID:krylorz,项目名称:New-Space-Scavs-Repo,代码行数:7,代码来源:ArmorSlot.cs

示例5: CreateHat

    private static Armor CreateHat()
    {
        Armor armor = new Armor();

        string[] hatNames = new string[] {
            "Small Hat",
            "Mid Hat",
            "Large Hat"
                                            };

        //fill in all of the values for that item type
        armor.Name = hatNames[Random.Range(0, hatNames.Length)];

        //assign properties for the item
        armor.ArmorLevel = Random.Range(10, 50);

        //assign the icon for the weapon
        armor.Icon = Resources.Load(GameSetting2.HAT_ICON_PATH + armor.Name) as Texture2D;

        //assign the eqipment slot where this can be assigned
        armor.Slot = EquipmentSlot.Head;

        //return the melee weapon
        return armor;
    }
开发者ID:ricoswx,项目名称:CS4213_Project,代码行数:25,代码来源:ItemGenerator.cs

示例6: HeavyArmorDamageRecalculation

        public void HeavyArmorDamageRecalculation()
        {
            //Test with an amount of 0
            Armor heavy = new Armor(ArmorType.Heavy, 0);

            Assert.AreEqual(80, heavy.RecalculateDamage(Pierce));
            Assert.AreEqual(120, heavy.RecalculateDamage(Siege));
            Assert.AreEqual(90, heavy.RecalculateDamage(Magic));
            Assert.AreEqual(100, heavy.RecalculateDamage(Chaos));

            //Test with an amount of 10
            heavy = new Armor(ArmorType.Heavy, 10);

            Assert.AreEqual(64, heavy.RecalculateDamage(Pierce));
            Assert.AreEqual(111, heavy.RecalculateDamage(Siege));
            Assert.AreEqual(85, heavy.RecalculateDamage(Magic));
            Assert.AreEqual(93, heavy.RecalculateDamage(Chaos));

            //Test with a high amount
            heavy = new Armor(ArmorType.Heavy, 10000);

            Assert.IsTrue(heavy.RecalculateDamage(Pierce) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Siege) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Magic) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Chaos) > 0);
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:26,代码来源:TestArmor.cs

示例7: Armor

 public Armor(Armor armor)
 {
     this.name = armor.name;
     this.type = armor.type;
     this.value = armor.value;
     this.armortype = armor.armortype;
     this.trait = armor.trait;
 }
开发者ID:kevinwegner,项目名称:ConsoleDungeonCrawler,代码行数:8,代码来源:Armor.cs

示例8: EquipArmor

 /// <summary>
 /// 穿上護甲
 /// </summary>
 void EquipArmor(Armor _armor)
 {
     //穿上裝備,如果返回false代表無法裝備
     if (!_armor.Equip())
         return;
     Equip(_armor, true);//穿上裝備
     AddArmorBuffer(_armor.BufferID);
 }
开发者ID:scozirge,项目名称:AVentureCapital,代码行数:11,代码来源:Equip.cs

示例9: takeArmor

 public void takeArmor(Armor someArmor)
 {
     if ( someArmor.Owner != null ) {
         throw new ArgumentException();
     }
     ownArmor = someArmor;
     ownArmor.Owner = this;
 }
开发者ID:MalxMalx,项目名称:Unit-2,代码行数:8,代码来源:Unit.cs

示例10: UpdateBonuses

	public void UpdateBonuses(Armor a, Weapon w) {
		if (a != null) {
			armorbonus = a.armorBonus;
		}
		if (w != null) {
			attackbonus = w.damageBonus;
			speedbonus = w.speedBonus;
		}
	}
开发者ID:NotYours180,项目名称:Survival,代码行数:9,代码来源:Status.cs

示例11: Clone

        public object Clone()
        {
            Armor armor = new Armor();

            armor.DmgBlock = this.DmgBlock;
            armor.Name = this.Name;

            return armor;
        }
开发者ID:elefantstudio-se,项目名称:ElefantStudio-Prototyp-Exempel,代码行数:9,代码来源:Armor.cs

示例12: AddItem

    public void AddItem(Item pItem)
    {
        pItems.Add(pItem);

        if (pItem.ItmType == Item.ItemType.Weapon && pEquipedWeapon == null)
            pEquipedWeapon = pItem as Weapon;
        else if (pItem.ItmType == Item.ItemType.Armor && pEquipedArmor == null)
            pEquipedArmor = pItem as Armor;
    }
开发者ID:Thex-PiedDroit,项目名称:Secret_of_Mana_Recreate,代码行数:9,代码来源:Inventory.cs

示例13: addArmor

 public bool addArmor(Armor a)
 {
     if(a.getWeight() + weight > weightLimit) {
         return false;
     } else {
         armors.Add(a);
         weight += a.getWeight();
         return true;
     }
 }
开发者ID:TheAlchemistStudio,项目名称:DnD,代码行数:10,代码来源:Inventory.cs

示例14: Unit

 public Unit(string name = defaultName, double health = defaultHealth)
 {
     if ( health < 10 || health > 100 ) {
         throw new ArgumentException();
     }
     this.name = name;
     this.health = health;
     ownWeapon = NoWeapon;
     ownArmor = NoArmor;
 }
开发者ID:MalxMalx,项目名称:Unit-2,代码行数:10,代码来源:Unit.cs

示例15: removeArmor

 public void removeArmor()
 {
     if(isPrimarySlotOccupied()){
         primaryarmor.transform.parent = null;
         primaryarmor.disableAbility();
         primaryarmor.enableSprite();
         primaryarmor.drop(owner.getCollider());
         defaultArmor();
         primaryarmor = null;
     }
 }
开发者ID:krylorz,项目名称:New-Space-Scavs-Repo,代码行数:11,代码来源:ArmorSlot.cs


注:本文中的Armor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。