First couple abilities implemented
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -46,6 +46,16 @@ public interface IHitData
|
||||
/// Fails the hit.
|
||||
/// </summary>
|
||||
void Fail();
|
||||
|
||||
/// <summary>
|
||||
/// Sets a flag on the hit data. This is used to mark certain conditions or states
|
||||
/// </summary>
|
||||
void SetFlag(StringKey flag);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether a flag is set on the hit data.
|
||||
/// </summary>
|
||||
bool HasFlag(StringKey flag);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -71,6 +81,18 @@ public record HitData : IHitData
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Fail() => HasFailed = true;
|
||||
|
||||
private HashSet<StringKey>? _flags;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetFlag(StringKey flag)
|
||||
{
|
||||
_flags ??= [];
|
||||
_flags.Add(flag);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool HasFlag(StringKey flag) => _flags != null && _flags.Contains(flag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user