Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SpawnPointSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_SpawnPoint;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity entity, notnull SaveContext context)
11 {
12 const SCR_SpawnPoint spawnPoint = SCR_SpawnPoint.Cast(entity);
13 const BaseContainer source = entity.GetPrefabData().GetPrefab();
14
15 const bool enabled = spawnPoint.IsSpawnPointEnabled();
16 bool enabledDefault;
17 source.Get("m_bSpawnPointEnabled", enabledDefault);
18
19 if (enabled == enabledDefault)
20 return ESerializeResult.DEFAULT;
21
22 context.WriteValue("version", 1);
23 context.WriteDefault(enabled, enabledDefault);
24 return ESerializeResult.OK;
25 }
26
27 //------------------------------------------------------------------------------------------------
28 override protected bool Deserialize(notnull IEntity entity, notnull LoadContext context)
29 {
30 SCR_SpawnPoint spawnPoint = SCR_SpawnPoint.Cast(entity);
31
32 int version;
33 context.ReadValue("version", version);
34
35 bool enabled;
36 if (context.Read(enabled))
37 spawnPoint.SetSpawnPointEnabled_S(enabled);
38
39 return true;
40 }
41}
class SCR_PersistentThreatSector GetTargetType()
Spawn point entity defines positions on which players can possibly spawn.
bool IsSpawnPointEnabled()
void SetSpawnPointEnabled_S(bool enabled)
bool Deserialize(notnull IEntity entity, notnull LoadContext context)
ESerializeResult Serialize(notnull IEntity entity, notnull SaveContext context)
ESerializeResult