30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using System.Linq;
|
|
using VOID.Generic.Dict;
|
|
using VOID.Generic.Objects.Accessory;
|
|
using VOID.Generic.Objects.Armor;
|
|
using VOID.Generic.Objects.Weapon;
|
|
using VOID.Generic.Objects.Wearable;
|
|
|
|
namespace VOID.Generic.Util
|
|
{
|
|
public static class WearableUtils
|
|
{
|
|
/// <returns>TRUE if matches given armor type.</returns>
|
|
public static bool IsType(WearableObject wearable, ArmorType armorType)
|
|
{
|
|
return wearable is ArmorObject armor && armor.armorData.armorType == armorType;
|
|
}
|
|
|
|
/// <returns>TRUE if matches given accessory type.</returns>
|
|
public static bool IsType(WearableObject wearable, AccessoryType accessoryType)
|
|
{
|
|
return wearable is AccessoryObject accessory && accessory.accessoryData.accessoryType == accessoryType;
|
|
}
|
|
|
|
/// <returns>TRUE if matches given weapon carry type.</returns>
|
|
public static bool IsWeaponCarryType(WearableObject wearable, params WeaponCarryType[] carryType)
|
|
{
|
|
return wearable is WeaponObject weapon && carryType.Contains(weapon.weaponData.weaponCarryType);
|
|
}
|
|
}
|
|
} |