removes ipopulatedefaultvalues (#10103) + update submodule
Co-authored-by: Paul Ritter <ritter.paul1@gmail.com>
This commit is contained in:
@@ -9,9 +9,9 @@ namespace Content.Shared.Alert;
|
|||||||
/// falls back to the id.
|
/// falls back to the id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public struct AlertKey :IPopulateDefaultValues
|
public struct AlertKey
|
||||||
{
|
{
|
||||||
public AlertType? AlertType { get; private set; }
|
public AlertType? AlertType { get; private set; } = Alert.AlertType.Error;
|
||||||
public readonly AlertCategory? AlertCategory;
|
public readonly AlertCategory? AlertCategory;
|
||||||
|
|
||||||
/// NOTE: if the alert has a category you must pass the category for this to work
|
/// NOTE: if the alert has a category you must pass the category for this to work
|
||||||
@@ -46,11 +46,6 @@ public struct AlertKey :IPopulateDefaultValues
|
|||||||
return AlertType.GetHashCode();
|
return AlertType.GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PopulateDefaultValues()
|
|
||||||
{
|
|
||||||
AlertType = Alert.AlertType.Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <param name="category">alert category, must not be null</param>
|
/// <param name="category">alert category, must not be null</param>
|
||||||
/// <returns>An alert key for the provided alert category. This must only be used for
|
/// <returns>An alert key for the provided alert category. This must only be used for
|
||||||
/// queries and never storage, as it is lacking an alert type.</returns>
|
/// queries and never storage, as it is lacking an alert type.</returns>
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ namespace Content.Shared.Storage;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public struct EntitySpawnEntry : IPopulateDefaultValues
|
public struct EntitySpawnEntry
|
||||||
{
|
{
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("id", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string? PrototypeId;
|
public string PrototypeId = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The probability that an item will spawn. Takes decimal form so 0.05 is 5%, 0.50 is 50% etc.
|
/// The probability that an item will spawn. Takes decimal form so 0.05 is 5%, 0.50 is 50% etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("prob")] public float SpawnProbability;
|
[DataField("prob")] public float SpawnProbability = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// orGroup signifies to pick between entities designated with an ID.
|
/// orGroup signifies to pick between entities designated with an ID.
|
||||||
@@ -44,10 +44,10 @@ public struct EntitySpawnEntry : IPopulateDefaultValues
|
|||||||
/// </example>
|
/// </example>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("orGroup")] public string? GroupId;
|
[DataField("orGroup")] public string? GroupId = null;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("amount")] public int Amount;
|
[DataField("amount")] public int Amount = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How many of this can be spawned, in total.
|
/// How many of this can be spawned, in total.
|
||||||
@@ -55,14 +55,9 @@ public struct EntitySpawnEntry : IPopulateDefaultValues
|
|||||||
/// Otherwise, it chooses a random value between <see cref="Amount"/> and <see cref="MaxAmount"/> on spawn.
|
/// Otherwise, it chooses a random value between <see cref="Amount"/> and <see cref="MaxAmount"/> on spawn.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("maxAmount")] public int MaxAmount;
|
[DataField("maxAmount")] public int MaxAmount = 1;
|
||||||
|
|
||||||
public void PopulateDefaultValues()
|
public EntitySpawnEntry() { }
|
||||||
{
|
|
||||||
Amount = 1;
|
|
||||||
MaxAmount = 1;
|
|
||||||
SpawnProbability = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class EntitySpawnCollection
|
public static class EntitySpawnCollection
|
||||||
|
|||||||
Submodule RobustToolbox updated: b2a71e5ef8...f16d41704b
Reference in New Issue
Block a user