Class PersistentChunk
Inheritance
System.Object
PersistentChunk
Assembly: Eco.World.dll
Syntax
public class PersistentChunk : WorldChunk, IChunk
Constructors
PersistentChunk()
Declaration
PersistentChunk(PersistentChunkPack)
Declaration
public PersistentChunk(PersistentChunkPack container)
Parameters
Fields
NumIdleTicksBeforeFreezing
Declaration
public const int NumIdleTicksBeforeFreezing = 15
Field Value
Type |
Description |
System.Int32 |
|
Properties
Active
Declaration
public bool Active { get; }
Property Value
Type |
Description |
System.Boolean |
|
ActiveChunks
Declaration
public static ConcurrentHashSet<PersistentChunk> ActiveChunks { get; }
Property Value
Container
Declaration
public PersistentChunkPack Container { get; }
Property Value
Frozen
Declaration
public bool Frozen { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasTransientBlocks
Declaration
public bool HasTransientBlocks { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
Convert(MigrationManager, Boolean)
Converts chunk from old format to new chunk format using migrationManager
.
It is required, because for optimization purposes chunk contains serialized blocks data, but when
schema changes block ids may be changed as well.
Declaration
public void Convert(MigrationManager migrationManager, bool legacy)
Parameters
Type |
Name |
Description |
MigrationManager |
migrationManager |
Migration manager containing information about old and new schemas.
|
System.Boolean |
legacy |
this flag used only for backward compatibility with 8.3, may be removed in 10.0.
|
Freeze()
Declaration
GetBlock(Vector3i)
Declaration
public override Block GetBlock(Vector3i localPosition)
Parameters
Type |
Name |
Description |
Vector3i |
localPosition |
|
Returns
Overrides
OnChanged()
Declaration
public override void OnChanged()
Overrides
OnDeserialized()
Declaration
protected void OnDeserialized()
OnNeighborEdgeChanged(Type)
Declaration
public void OnNeighborEdgeChanged(Type blockType)
Parameters
Type |
Name |
Description |
System.Type |
blockType |
|
PackIntoBson()
Declaration
public override BSONObject PackIntoBson()
Returns
Overrides
RemoveTransientBlocks()
Declaration
public void RemoveTransientBlocks()
SetBlockInternal(Block, Vector3i)
Declaration
protected override void SetBlockInternal(Block block, Vector3i localPosition)
Parameters
Overrides
SetContainer(PersistentChunkPack)
Declaration
public void SetContainer(PersistentChunkPack container)
Parameters
Thaw(Boolean)
It may not invalidate cache in case if it was thawed just for readonly access. Readonly access means that it have to make again array of blocks, but it doesnt changed anything, so cached bson bytes are still valid for sending to clients.
Declaration
public void Thaw(bool invalidateCache = true)
Parameters
Type |
Name |
Description |
System.Boolean |
invalidateCache |
|
TryFreeze()
Declaration
TryTick()
Declaration
UpdateHasTransientBlocks()
Recalculates if chunk has Transient blocks, updates HasTransientBlocks property and returns new value. If the chunk is frozen then just returns current value or false
if undefined.
Declaration
public bool UpdateHasTransientBlocks()
Returns
Type |
Description |
System.Boolean |
|
WakeUp(Vector3i)
Declaration
public void WakeUp(Vector3i localPosition)
Parameters
Type |
Name |
Description |
Vector3i |
localPosition |
|
WakeUpFromNeighbour(Vector3i)
Declaration
public void WakeUpFromNeighbour(Vector3i localPosition)
Parameters
Type |
Name |
Description |
Vector3i |
localPosition |
|
Implements