using Content.Shared._CP14.ResearchTable;
using Content.Shared._CP14.Skill.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.Skill.Components;
///
/// Component that stores the skills learned by a player and their progress in the skill trees.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
[Access(typeof(CP14SharedSkillSystem), typeof(CP14SharedResearchSystem))]
public sealed partial class CP14SkillStorageComponent : Component
{
///
/// Tracks skills that are learned without spending memory points.
/// the skills that are here are DUBLED in the LearnedSkills,
///
[DataField, AutoNetworkedField]
public List> FreeLearnedSkills = new();
[DataField, AutoNetworkedField]
public List> LearnedSkills = new();
///
/// skills that the player has learned on the research table, but has not yet learned in the skill tree.
///
[DataField, AutoNetworkedField]
public List> ResearchedSkills = new();
///
/// The number of experience points spent on skills. Technically this could be calculated via LearnedSkills, but this is a cached value for optimization.
///
[DataField, AutoNetworkedField]
public FixedPoint2 SkillsSumExperience = 0;
///
/// The maximum ceiling of experience points that can be spent on learning skills. Not tied to a category.
///
[DataField, AutoNetworkedField]
public FixedPoint2 ExperienceMaxCap = 5;
}
///
/// Raised when a player attempts to learn a skill. This is sent from the client to the server.
///
[Serializable, NetSerializable]
public sealed class CP14TryLearnSkillMessage(NetEntity entity, ProtoId skill) : EntityEventArgs
{
public readonly NetEntity Entity = entity;
public readonly ProtoId Skill = skill;
}