67 lines
1.1 KiB
C#

using Kryz.CharacterStats;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public enum WeaponType
{
// Two-Handed Weapons (Build-defining)
Staff,
Spear,
Scythe,
Hammer,
Bow,
Crossbow,
Axe,
// One-Handed Weapons (Flexible)
Sword,
Shield,
Dagger,
Book
}
public static class WeaponTypeExtensions
{
private static readonly HashSet<WeaponType> TwoHandedWeapons = new()
{
WeaponType.Staff,
WeaponType.Spear,
WeaponType.Scythe,
WeaponType.Hammer,
WeaponType.Bow,
WeaponType.Crossbow,
WeaponType.Axe
};
public static bool IsTwoHanded(this WeaponType weaponType)
{
return TwoHandedWeapons.Contains(weaponType);
}
public static bool IsOneHanded(this WeaponType weaponType)
{
return !IsTwoHanded(weaponType);
}
}
namespace Kryz.CharacterStats.Examples
{
public enum EquipmentType
{
Helmet,
Shoulder,
Chest,
Belt,
Legs,
Bracers,
Gloves,
Boots,
Weapon1,
Weapon2,
}
}