2023-06-18 18:35:19 -04:00
|
|
|
using Content.Shared.Lathe;
|
2022-12-20 17:39:57 -05:00
|
|
|
using Content.Shared.Research.Prototypes;
|
2023-05-15 16:17:30 -04:00
|
|
|
using Content.Shared.Research.Systems;
|
2022-12-20 17:39:57 -05:00
|
|
|
using Robust.Shared.GameStates;
|
2023-05-15 16:17:30 -04:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2022-12-20 17:39:57 -05:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
|
|
|
|
2023-05-15 16:17:30 -04:00
|
|
|
namespace Content.Shared.Research.Components;
|
|
|
|
|
|
2023-06-18 18:35:19 -04:00
|
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedResearchSystem), typeof(SharedLatheSystem)), AutoGenerateComponentState]
|
2023-05-15 16:17:30 -04:00
|
|
|
public sealed partial class TechnologyDatabaseComponent : Component
|
2022-12-20 17:39:57 -05:00
|
|
|
{
|
2023-05-15 16:17:30 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// A main discipline that locks out other discipline technology past a certain tier.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AutoNetworkedField]
|
|
|
|
|
[DataField("mainDiscipline", customTypeSerializer: typeof(PrototypeIdSerializer<TechDisciplinePrototype>))]
|
|
|
|
|
public string? MainDiscipline;
|
2022-12-20 17:39:57 -05:00
|
|
|
|
2023-09-29 22:14:16 -07:00
|
|
|
[AutoNetworkedField]
|
2023-05-15 16:17:30 -04:00
|
|
|
[DataField("currentTechnologyCards")]
|
|
|
|
|
public List<string> CurrentTechnologyCards = new();
|
2022-12-20 17:39:57 -05:00
|
|
|
|
2022-12-25 16:22:23 -05:00
|
|
|
/// <summary>
|
2023-05-15 16:17:30 -04:00
|
|
|
/// Which research disciplines are able to be unlocked
|
2022-12-25 16:22:23 -05:00
|
|
|
/// </summary>
|
2023-09-29 22:14:16 -07:00
|
|
|
[AutoNetworkedField]
|
2023-05-15 16:17:30 -04:00
|
|
|
[DataField("supportedDisciplines", customTypeSerializer: typeof(PrototypeIdListSerializer<TechDisciplinePrototype>))]
|
|
|
|
|
public List<string> SupportedDisciplines = new();
|
2022-12-25 16:22:23 -05:00
|
|
|
|
2023-05-15 16:17:30 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// The ids of all the technologies which have been unlocked.
|
|
|
|
|
/// </summary>
|
2023-09-29 22:14:16 -07:00
|
|
|
[AutoNetworkedField]
|
2023-05-15 16:17:30 -04:00
|
|
|
[DataField("unlockedTechnologies", customTypeSerializer: typeof(PrototypeIdListSerializer<TechnologyPrototype>))]
|
|
|
|
|
public List<string> UnlockedTechnologies = new();
|
2022-12-20 17:39:57 -05:00
|
|
|
|
2023-05-15 16:17:30 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// The ids of all the lathe recipes which have been unlocked.
|
|
|
|
|
/// This is maintained alongside the TechnologyIds
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// todo: if you unlock all the recipes in a tech, it doesn't count as unlocking the tech. sadge
|
2023-09-29 22:14:16 -07:00
|
|
|
[AutoNetworkedField]
|
2023-05-15 16:17:30 -04:00
|
|
|
[DataField("unlockedRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))]
|
|
|
|
|
public List<string> UnlockedRecipes = new();
|
2022-12-20 17:39:57 -05:00
|
|
|
}
|
2023-05-15 16:17:30 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event raised on the database whenever its
|
|
|
|
|
/// technologies or recipes are modified.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This event is forwarded from the
|
|
|
|
|
/// server to all of it's clients.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[ByRefEvent]
|
|
|
|
|
public readonly record struct TechnologyDatabaseModifiedEvent;
|