using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
namespace Content.Shared.Language.Components;
///
/// Stores the current state of the languages the entity can speak and understand.
///
///
/// All fields of this component are populated during a DetermineEntityLanguagesEvent.
/// They are not to be modified externally.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class LanguageSpeakerComponent : Component
{
public override bool SendOnlyToOwner => true;
///
/// The current language the entity uses when speaking.
/// Other listeners will hear the entity speak in this language.
///
[DataField]
public string CurrentLanguage = ""; // The language system will override it on mapinit
///
/// List of languages this entity can speak at the current moment.
///
[DataField]
public List> SpokenLanguages = [];
///
/// List of languages this entity can understand at the current moment.
///
[DataField]
public List> UnderstoodLanguages = [];
[Serializable, NetSerializable]
public sealed class State : ComponentState
{
public string CurrentLanguage = default!;
public List> SpokenLanguages = default!;
public List> UnderstoodLanguages = default!;
}
}