1using System.Globalization;
34 if (entity == componentPlayer.
Entity) {
43 float num =
float.MaxValue;
48 result = componentPlayer;
56 throw new InvalidOperationException(
"Too many players.");
59 throw new InvalidOperationException(
"Player already added.");
68 throw new InvalidOperationException(
"Player does not exist.");
78 public virtual void Update(
float dt) {
97 foreach (KeyValuePair<string, object> item
in valuesDictionary.GetValue<
ValuesDictionary>(
"Players")) {
100 playerData.PlayerIndex =
int.Parse(item.Key, CultureInfo.InvariantCulture);
109 valuesDictionary.SetValue(
"Players", valuesDictionary2);
112 valuesDictionary2.SetValue(playersDatum.
PlayerIndex.ToString(CultureInfo.InvariantCulture), valuesDictionary3);
113 playersDatum.
Save(valuesDictionary3);
ComponentBody ComponentBody
void Load(ValuesDictionary valuesDictionary)
ComponentPlayer ComponentPlayer
void Save(ValuesDictionary valuesDictionary)
void OnEntityRemoved(Entity entity)
void OnEntityAdded(Entity entity)
static void SwitchScreen(string name, params object[] parameters)
List< ComponentPlayer > m_componentPlayers
override void Load(ValuesDictionary valuesDictionary)
Vector3 GlobalSpawnPosition
ReadOnlyList< PlayerData > PlayersData
virtual void Update(float dt)
virtual Action< PlayerData > PlayerRemoved
void RemovePlayerData(PlayerData playerData)
override void Save(ValuesDictionary valuesDictionary)
SubsystemTime m_subsystemTime
override void OnEntityAdded(Entity entity)
ComponentPlayer FindNearestPlayer(Vector3 position)
ReadOnlyList< ComponentPlayer > ComponentPlayers
bool PlayerStartedPlaying
bool IsPlayer(Entity entity)
override void OnEntityRemoved(Entity entity)
virtual Action< PlayerData > PlayerAdded
virtual void UpdateComponentPlayers()
void AddPlayerData(PlayerData playerData)
List< PlayerData > m_playersData
ValuesDictionary ValuesDictionary
static float DistanceSquared(Vector3 v1, Vector3 v2)