using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Holopad;
///
/// Holds data pertaining to entities that are using holopads
///
///
/// This component is added and removed automatically from entities
///
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedHolopadSystem))]
public sealed partial class HolopadUserComponent : Component
{
///
/// A list of holopads that the user is interacting with
///
[ViewVariables]
public HashSet> LinkedHolopads = new();
}
///
/// A networked event raised when the visual state of a hologram is being updated
///
[Serializable, NetSerializable]
public sealed class HolopadHologramVisualsUpdateEvent : EntityEventArgs
{
///
/// The hologram being updated
///
public readonly NetEntity Hologram;
///
/// The target the hologram is copying
///
public readonly NetEntity? Target;
public HolopadHologramVisualsUpdateEvent(NetEntity hologram, NetEntity? target = null)
{
Hologram = hologram;
Target = target;
}
}
///
/// A networked event raised when the visual state of a hologram is being updated
///
[Serializable, NetSerializable]
public sealed class HolopadUserTypingChangedEvent : EntityEventArgs
{
///
/// The hologram being updated
///
public readonly NetEntity User;
///
/// The typing indicator state
///
public readonly bool IsTyping;
public HolopadUserTypingChangedEvent(NetEntity user, bool isTyping)
{
User = user;
IsTyping = isTyping;
}
}
///
/// A networked event raised by the server to request the current visual state of a target player entity
///
[Serializable, NetSerializable]
public sealed class PlayerSpriteStateRequest : EntityEventArgs
{
///
/// The player entity in question
///
public readonly NetEntity TargetPlayer;
public PlayerSpriteStateRequest(NetEntity targetPlayer)
{
TargetPlayer = targetPlayer;
}
}
///
/// The client's response to a
///
[Serializable, NetSerializable]
public sealed class PlayerSpriteStateMessage : EntityEventArgs
{
public readonly NetEntity SpriteEntity;
///
/// Data needed to reconstruct the player's sprite component layers
///
public readonly PrototypeLayerData[]? SpriteLayerData;
public PlayerSpriteStateMessage(NetEntity spriteEntity, PrototypeLayerData[]? spriteLayerData = null)
{
SpriteEntity = spriteEntity;
SpriteLayerData = spriteLayerData;
}
}