Files
OldThink/Content.Server/Construction/Conditions/ToiletLidClosed.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

36 lines
1.1 KiB
C#

#nullable enable
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Watercloset;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Server.Construction.Conditions
{
[UsedImplicitly]
public class ToiletLidClosed : IEdgeCondition
{
public async Task<bool> Condition(IEntity entity)
{
if (!entity.TryGetComponent(out ToiletComponent? toilet)) return false;
return !toilet.LidOpen;
}
public bool DoExamine(IEntity entity, FormattedMessage message, bool inExamineRange)
{
if (!entity.TryGetComponent(out ToiletComponent? toilet)) return false;
if (!toilet.LidOpen) return false;
message.AddMarkup(Loc.GetString("Use a [color=yellow]crowbar[/color] to close the lid.\n"));
return true;
}
void IExposeData.ExposeData(ObjectSerializer serializer)
{
}
}
}