Ambient music rules refactor (#29921)

* refactor

* dutypo
This commit is contained in:
Ed
2024-07-14 16:58:48 +03:00
committed by GitHub
parent 7d9653fff7
commit 1c74ffb8e4
13 changed files with 414 additions and 388 deletions

View File

@@ -0,0 +1,19 @@
namespace Content.Shared.Random.Rules;
/// <summary>
/// Returns true if griduid and mapuid match (AKA on 'planet').
/// </summary>
public sealed partial class OnMapGridRule : RulesRule
{
public override bool Check(EntityManager entManager, EntityUid uid)
{
if (!entManager.TryGetComponent(uid, out TransformComponent? xform) ||
xform.GridUid != xform.MapUid ||
xform.MapUid == null)
{
return Inverted;
}
return !Inverted;
}
}