using Content.Shared.Teleportation.Systems;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Teleportation.Components;
///
/// This is used for an entity that, when linked to another valid entity, allows the two to swap positions,
/// additionally swapping the positions of the parents.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SwapTeleporterSystem))]
public sealed partial class SwapTeleporterComponent : Component
{
///
/// The other SwapTeleporterComponent that this one is linked to
///
[DataField, AutoNetworkedField]
public EntityUid? LinkedEnt;
///
/// the time at which ends and the teleportation occurs
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public TimeSpan? TeleportTime;
///
/// Delay after starting the teleport and it occuring.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan TeleportDelay = TimeSpan.FromSeconds(2.5f);
///
/// The time at which ends and teleportation can occur again.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
[AutoPausedField]
public TimeSpan NextTeleportUse;
///
/// A minimum waiting period inbetween teleports.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan Cooldown = TimeSpan.FromMinutes(5);
///
/// Sound played when teleportation begins
///
[DataField]
public SoundSpecifier? TeleportSound = new SoundPathSpecifier("/Audio/Weapons/flash.ogg");
///
/// A whitelist for what entities are valid for .
///
[DataField]
public EntityWhitelist TeleporterWhitelist = new();
}
[Serializable, NetSerializable]
public enum SwapTeleporterVisuals : byte
{
Linked
}