本文整理汇总了C#中Mooege.Common.MPQ.FileFormats.ItemTypeTable类的典型用法代码示例。如果您正苦于以下问题:C# ItemTypeTable类的具体用法?C# ItemTypeTable怎么用?C# ItemTypeTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemTypeTable类属于Mooege.Common.MPQ.FileFormats命名空间,在下文中一共展示了ItemTypeTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public List<IItemAttributeCreator> Create(ItemTypeTable itemType)
{
var creatorList = new List<IItemAttributeCreator> {new DefaultAttributeCreator()};
//if (Item.IsWeapon(itemType)) creatorList.Add(new WeaponAttributeCreator());
//else if (Item.IsPotion(itemType)) creatorList.Add(new PotionAttributeCreator());
return creatorList;
}
示例2: HierarchyToHashList
public static List<int> HierarchyToHashList(ItemTypeTable itemType)
{
List<int> result = new List<int>();
var types = HierarchyToList(itemType);
foreach (var type in types)
{
result.Add(type.Hash);
}
return result;
}
示例3: HierarchyToList
public static List<ItemTypeTable> HierarchyToList(ItemTypeTable itemType)
{
List<ItemTypeTable> result = new List<ItemTypeTable>();
var curType = itemType;
if (curType != null)
{
result.Add(curType);
while (curType.ParentType != -1)
{
curType = ItemTypes[curType.ParentType];
result.Add(curType);
}
}
return result;
}
示例4: IsDye
public static bool IsDye(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Dye");
}
示例5: IsJournalOrScroll
public static bool IsJournalOrScroll(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Scroll") ||
ItemGroup.IsSubType(itemType, "Book");
}
示例6: IsRuneOrJewel
public static bool IsRuneOrJewel(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Gem") ||
ItemGroup.IsSubType(itemType, "SpellRune");
}
示例7: IsAccessory
public static bool IsAccessory(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Jewelry");
}
示例8: IsGold
public static bool IsGold(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Gold");
}
示例9: IsBelt
public static bool IsBelt(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Belt");
}
示例10: IsOffhand
public static bool IsOffhand(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Offhand");
}
示例11: Is2H
public static bool Is2H(ItemTypeTable type)
{
return (type.Array[0] & 0x400) != 0;
}
示例12: IsSubType
public static bool IsSubType(ItemTypeTable type, int rootTypeHash)
{
if (type == null)
return false;
if (type.Hash == rootTypeHash)
return true;
var curType = type;
while (curType.ParentType != -1)
{
curType = ItemTypes[curType.ParentType];
if (curType.Hash == rootTypeHash)
{
return true;
}
}
return false;
}
示例13: IsWeapon
public static bool IsWeapon(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Weapon");
}
示例14: GenerateRandom
// generates a random item from given type category.
// we can also set a difficulty mode parameter here, but it seems current db doesnt have nightmare or hell-mode items with valid snoId's /raist.
public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor player, ItemTypeTable type)
{
var itemDefinition = GetRandom(Items.Values
.Where(def => ItemGroup
.HierarchyToHashList(ItemGroup.FromHash(def.ItemType1)).Contains(type.Hash)).ToList());
return CreateItem(player, itemDefinition);
}
示例15: IsArmor
public static bool IsArmor(ItemTypeTable itemType)
{
return ItemGroup.IsSubType(itemType, "Armor");
}