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, fieldDeltas: true)]
[Access(typeof(CP14SharedSkillSystem))]
public sealed partial class CP14SkillStorageComponent : Component
{
///
/// Skill trees displayed in the skill tree interface. Only skills from these trees can be learned by this player.
///
[DataField, AutoNetworkedField]
public HashSet> AvailableSkillTrees = new();
///
/// Tracks skills that are learned without spending memory points.
/// the skills that are here are DOUBLED in the LearnedSkills,
///
[DataField, AutoNetworkedField]
public List> FreeLearnedSkills = new();
[DataField, AutoNetworkedField]
public List> LearnedSkills = new();
[DataField, AutoNetworkedField]
public Dictionary, CP14SkillPointContainerEntry> SkillPoints = new();
}
[DataDefinition, Serializable, NetSerializable]
public sealed partial class CP14SkillPointContainerEntry
{
///
/// The number of experience points spent on skills.
///
[DataField]
public FixedPoint2 Sum = 0;
///
/// The maximum of experience points that can be spent on learning skills.
///
[DataField]
public FixedPoint2 Max = 0;
}
///
/// 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;
}