2021-04-21 12:00:14 +02:00
|
|
|
using Content.Server.Advertisements;
|
2021-09-23 18:02:22 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2021-04-21 12:00:14 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Advertise
|
2021-04-21 12:00:14 +02:00
|
|
|
{
|
2022-06-07 15:26:28 +02:00
|
|
|
[RegisterComponent, Access(typeof(AdvertiseSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class AdvertiseComponent : Component
|
2021-04-21 12:00:14 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
/// Minimum time in seconds to wait before saying a new ad, in seconds. Has to be larger than or equal to 1.
|
2021-04-21 12:00:14 +02:00
|
|
|
/// </summary>
|
2021-10-01 21:32:02 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("minWait")]
|
2021-09-23 18:02:22 +02:00
|
|
|
public int MinimumWait { get; } = 8 * 60;
|
2021-04-21 12:00:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
/// Maximum time in seconds to wait before saying a new ad, in seconds. Has to be larger than or equal
|
|
|
|
|
/// to <see cref="MinimumWait"/>
|
2021-04-21 12:00:14 +02:00
|
|
|
/// </summary>
|
2021-10-01 21:32:02 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("maxWait")]
|
2021-09-23 18:02:22 +02:00
|
|
|
public int MaximumWait { get; } = 10 * 60;
|
2021-04-21 12:00:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
/// The identifier for the advertisements pack prototype.
|
2021-04-21 12:00:14 +02:00
|
|
|
/// </summary>
|
2023-07-30 05:34:51 +12:00
|
|
|
[DataField("pack", customTypeSerializer:typeof(PrototypeIdSerializer<AdvertisementsPackPrototype>), required: true)]
|
2021-09-23 18:02:22 +02:00
|
|
|
public string PackPrototypeId { get; } = string.Empty;
|
2021-04-21 12:00:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
/// The next time an advertisement will be said.
|
2021-04-21 12:00:14 +02:00
|
|
|
/// </summary>
|
2021-10-01 21:32:02 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-09-23 18:02:22 +02:00
|
|
|
public TimeSpan NextAdvertisementTime { get; set; } = TimeSpan.Zero;
|
2021-04-21 12:00:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
/// Whether the entity will say advertisements or not.
|
2021-04-21 12:00:14 +02:00
|
|
|
/// </summary>
|
2021-09-23 18:02:22 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public bool Enabled { get; set; } = true;
|
2021-04-21 12:00:14 +02:00
|
|
|
}
|
|
|
|
|
}
|