本文整理汇总了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);
}
示例2: Armor
public Armor(Armor armor)
: base(armor)
{
this.armorValue = armor.ArmorValue;
this.exterieur = armor.exterieur;
this.interieur = armor.interieur;
}
示例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());
}
示例4: changeArmor
void changeArmor(Armor armor)
{
if(armorSwitcher != null){
armorSwitcher.changeAnimationLayer(armor.armorAnimationLayerName);
armorSwitcher.switchArm(armor.armSprite);
}
}
示例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;
}
示例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);
}
示例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;
}
示例8: EquipArmor
/// <summary>
/// 穿上護甲
/// </summary>
void EquipArmor(Armor _armor)
{
//穿上裝備,如果返回false代表無法裝備
if (!_armor.Equip())
return;
Equip(_armor, true);//穿上裝備
AddArmorBuffer(_armor.BufferID);
}
示例9: takeArmor
public void takeArmor(Armor someArmor)
{
if ( someArmor.Owner != null ) {
throw new ArgumentException();
}
ownArmor = someArmor;
ownArmor.Owner = this;
}
示例10: UpdateBonuses
public void UpdateBonuses(Armor a, Weapon w) {
if (a != null) {
armorbonus = a.armorBonus;
}
if (w != null) {
attackbonus = w.damageBonus;
speedbonus = w.speedBonus;
}
}
示例11: Clone
public object Clone()
{
Armor armor = new Armor();
armor.DmgBlock = this.DmgBlock;
armor.Name = this.Name;
return armor;
}
示例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;
}
示例13: addArmor
public bool addArmor(Armor a)
{
if(a.getWeight() + weight > weightLimit) {
return false;
} else {
armors.Add(a);
weight += a.getWeight();
return true;
}
}
示例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;
}
示例15: removeArmor
public void removeArmor()
{
if(isPrimarySlotOccupied()){
primaryarmor.transform.parent = null;
primaryarmor.disableAbility();
primaryarmor.enableSprite();
primaryarmor.drop(owner.getCollider());
defaultArmor();
primaryarmor = null;
}
}