Files
tbd-station-14/Content.Shared/GameObjects/EntitySystemMessages/VerbSystemMessages.cs
Acruid 6edc416afc EntitySystemMessage Removal & InteractionSystem directed events (#3572)
* Removed obsolete EntitySystemMessage, now everything uses the base EntityEventArgs or the derived HandledEntityEventArgs.
Setup InteractionSystem to use new directed events.

* Update Submodule.
2021-03-09 11:22:48 -08:00

72 lines
2.1 KiB
C#

#nullable enable
using System;
using Content.Shared.GameObjects.Verbs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.GameObjects.EntitySystemMessages
{
public static class VerbSystemMessages
{
[Serializable, NetSerializable]
public class RequestVerbsMessage : EntityEventArgs
{
public readonly EntityUid EntityUid;
public RequestVerbsMessage(EntityUid entityUid)
{
EntityUid = entityUid;
}
}
[Serializable, NetSerializable]
public class VerbsResponseMessage : EntityEventArgs
{
public readonly NetVerbData[] Verbs;
public readonly EntityUid Entity;
public VerbsResponseMessage(NetVerbData[] verbs, EntityUid entity)
{
Verbs = verbs;
Entity = entity;
}
[Serializable, NetSerializable]
public readonly struct NetVerbData
{
public readonly string Text;
public readonly string Key;
public readonly string Category;
public readonly SpriteSpecifier? Icon;
public readonly SpriteSpecifier? CategoryIcon;
public readonly bool Available;
public NetVerbData(VerbData data, string key)
{
Text = data.Text;
Key = key;
Category = data.Category;
CategoryIcon = data.CategoryIcon;
Icon = data.Icon;
Available = data.Visibility == VerbVisibility.Visible;
}
}
}
[Serializable, NetSerializable]
public class UseVerbMessage : EntityEventArgs
{
public readonly EntityUid EntityUid;
public readonly string VerbKey;
public UseVerbMessage(EntityUid entityUid, string verbKey)
{
EntityUid = entityUid;
VerbKey = verbKey;
}
}
}
}