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
{
/// TRUE if matches given armor type.
public static bool IsType(WearableObject wearable, ArmorType armorType)
{
return wearable is ArmorObject armor && armor.armorData.armorType == armorType;
}
/// TRUE if matches given accessory type.
public static bool IsType(WearableObject wearable, AccessoryType accessoryType)
{
return wearable is AccessoryObject accessory && accessory.accessoryData.accessoryType == accessoryType;
}
/// TRUE if matches given weapon carry type.
public static bool IsWeaponCarryType(WearableObject wearable, params WeaponCarryType[] carryType)
{
return wearable is WeaponObject weapon && carryType.Contains(weapon.weaponData.weaponCarryType);
}
}
}