Files
crystall-punk-14/Content.Shared/GameObjects/EntitySystemMessages/VerbSystemMessages.cs

72 lines
2.1 KiB
C#
Raw Normal View History

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