Skip to main content

StaticGenerationParent

A class in Root.Township, the global namespace.

Networked root for static generation: picks a seed on the server, saves it, sends it to joining players, and each side regenerates the same static children from that seed.

Constructors​

MemberWhat it is
StaticGenerationParent()Creates a StaticGenerationParent with default values.

Fields​

8 private and internal fields
MemberWhat it is
private bool btnTestInspector button that calls Test.
private bool btnTestRestInspector button that calls TestReset.
private NetworkEntity entityBacking field for Entity.
private bool isGeneratedTrue once the targets have been generated, so a second Generate call does nothing.
private static Logger loggerNLog logger; reports null entries in targets.
private int seedRandom seed for generation. -1 until the server picks one or loads it from the save.
private MethodSync syncMethod sync that sends the seed to clients.
private List<GameObject> targetsChild objects whose static generation this parent runs.

Properties​

MemberWhat it is
NetworkEntity Entity { get; }The NetworkEntity on this object, cached on Initialize.

Methods​

10 private and internal methods
MemberWhat it is
private void Generate(SpawnData data)The private overload runs static generation on this object with the saved seed. The interface one generates each of targets with its own random seed, once until Reset.
private void IStaticGeneration.Generate(NetworkEntity dynamicParent, SpawnData spawnData)The private overload runs static generation on this object with the saved seed. The interface one generates each of targets with its own random seed, once until Reset.
private void Alta.Networking.INetworkEntityBehaviour.Initialize()Caches the entity and sets up the StaticSeed method sync.
private void Alta.Networking.INetworkEntityBehaviour.InitializeAsServer(SpawnData data)Server: picks a random seed if none was loaded, then generates.
private void Alta.Networking.INetworkEntityBehaviour.OnConnected(Player player)Server: sends the seed to the joining player.
private void Alta.Networking.INetworkEntityBehaviour.OnDisconnected(Player player)Does nothing.
private void IStaticGeneration.Reset()Clears isGenerated and resets every target.
private void Sync(IPlayer player, Stream stream)Reads or writes the seed; a client that receives it generates the static content.
private void Test()Editor button: resets and regenerates with the current seed, or a random one if none is set.
private void TestReset()Editor button: resets all static generation on this object.