using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
namespace Content.Shared.Throwing
{
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ThrownItemComponent : Component
{
///
/// The entity that threw this entity.
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public EntityUid? Thrower { get; set; }
///
/// The timestamp at which this entity was thrown.
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public TimeSpan? ThrownTime { get; set; }
///
/// Compared to to land this entity, if any.
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public TimeSpan? LandTime { get; set; }
///
/// Whether or not this entity was already landed.
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool Landed { get; set; }
///
/// Whether or not to play a sound when the entity lands.
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool PlayLandSound { get; set; }
}
[Serializable, NetSerializable]
public sealed class ThrownItemComponentState : ComponentState
{
public NetEntity? Thrower { get; }
public ThrownItemComponentState(NetEntity? thrower)
{
Thrower = thrower;
}
}
}