Show / Hide Table of Contents

Class WorldChunkGrid

Inheritance
System.Object
WorldChunkGrid
PersistentChunkGrid
Implements
INetObject
INetObjectPriority
Namespace: Eco.World
Assembly: Eco.World.dll
Syntax
public abstract class WorldChunkGrid : ChunkGrid<PersistentChunk>, INetObject, INetObjectPriority

Constructors

WorldChunkGrid()

Declaration
public WorldChunkGrid()

WorldChunkGrid(NetObject, IChunkContainer<PersistentChunk>, Boolean)

Declaration
public WorldChunkGrid(NetObject owner, IChunkContainer<PersistentChunk> container, bool threadSafe)
Parameters
Type Name Description
NetObject owner
IChunkContainer<PersistentChunk> container
System.Boolean threadSafe

WorldChunkGrid(IChunkContainer<PersistentChunk>, Boolean)

Declaration
public WorldChunkGrid(IChunkContainer<PersistentChunk> container, bool threadSafe)
Parameters
Type Name Description
IChunkContainer<PersistentChunk> container
System.Boolean threadSafe

Properties

Active

Declaration
public bool Active { get; set; }
Property Value
Type Description
System.Boolean

ChunkSize

Declaration
public Vector3i ChunkSize { get; }
Property Value
Type Description
Vector3i

ID

Declaration
public int ID { get; }
Property Value
Type Description
System.Int32

InitialStateChannel

Declaration
public NetworkChannel InitialStateChannel { get; }
Property Value
Type Description
NetworkChannel

NetObj

Declaration
public NetObject NetObj { get; }
Property Value
Type Description
NetObject

NetObjectCreationRealtime

Declaration
public double NetObjectCreationRealtime { get; set; }
Property Value
Type Description
System.Double

Priority

Declaration
public float Priority { get; }
Property Value
Type Description
System.Single

UpdateChannel

Declaration
public NetworkChannel UpdateChannel { get; }
Property Value
Type Description
NetworkChannel

VoxelSize

Declaration
public Vector3i VoxelSize { get; }
Property Value
Type Description
Vector3i

Methods

CalculateChunkEncasement(Action<Single>)

Declaration
public void CalculateChunkEncasement(Action<float> updateAction)
Parameters
Type Name Description
System.Action<System.Single> updateAction

DeleteBlock(WrappedWorldPosition3i, Boolean)

See DeleteBlock(WrappedWorldPosition3i, Boolean)

Declaration
public virtual void DeleteBlock(WrappedWorldPosition3i worldPos, bool checkForWaterFlow = true)
Parameters
Type Name Description
WrappedWorldPosition3i worldPos
System.Boolean checkForWaterFlow

FillCache(Vector2i, Array2D<Int32>, Array2D<Block>)

Completes arrays of top block position and top solid block type into arrays. It's faster than go column by column since it re-uses same chunk for all positions (and chunk look up is slow)

Declaration
public void FillCache(Vector2i chunkPos2D, Array2D<int> topBlockHeight, Array2D<Block> topSolidBlock)
Parameters
Type Name Description
Vector2i chunkPos2D
Array2D<System.Int32> topBlockHeight
Array2D<Block> topSolidBlock

GetBlock(WrappedWorldPosition3i)

Declaration
public Block GetBlock(WrappedWorldPosition3i worldPos)
Parameters
Type Name Description
WrappedWorldPosition3i worldPos
Returns
Type Description
Block

GetMaxY(Vector2i)

Declaration
public int GetMaxY(Vector2i worldPos)
Parameters
Type Name Description
Vector2i worldPos
Returns
Type Description
System.Int32

GetTopBlockHeight(Vector2i)

Declaration
public int GetTopBlockHeight(Vector2i worldPos)
Parameters
Type Name Description
Vector2i worldPos
Returns
Type Description
System.Int32

GetTopSolidBlock(Vector2i)

Declaration
public Block GetTopSolidBlock(Vector2i worldPos)
Parameters
Type Name Description
Vector2i worldPos
Returns
Type Description
Block

IsNotRelevant(INetObjectViewer)

Declaration
public virtual bool IsNotRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsRelevant(INetObjectViewer)

Declaration
public virtual bool IsRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsUpdated(INetObjectViewer)

Declaration
public virtual bool IsUpdated(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

ReceiveInitialState(BSONObject)

Declaration
public virtual void ReceiveInitialState(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

ReceiveUpdate(BSONObject)

Declaration
public virtual void ReceiveUpdate(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

SendInitialState(BSONObject, INetObjectViewer)

Declaration
public virtual void SendInitialState(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

SendUpdate(BSONObject, INetObjectViewer)

Declaration
public virtual void SendUpdate(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

SetBlock(Type, WrappedWorldPosition3i, PersistentChunk, Object[])

If you know the chunk you can pass it to avoid lookup for better performance

Declaration
public Block SetBlock(Type blockType, WrappedWorldPosition3i worldPos, PersistentChunk chunk = null, params object[] args)
Parameters
Type Name Description
System.Type blockType
WrappedWorldPosition3i worldPos
PersistentChunk chunk
System.Object[] args
Returns
Type Description
Block

SetBlock(Type, WrappedWorldPosition3i, Object[])

Declaration
public Block SetBlock(Type blockType, WrappedWorldPosition3i worldPos, params object[] args)
Parameters
Type Name Description
System.Type blockType
WrappedWorldPosition3i worldPos
System.Object[] args
Returns
Type Description
Block

SetBlock<T>(WrappedWorldPosition3i, PersistentChunk, Object[])

If you know the chunk you can pass it to avoid lookup for better performance

Declaration
public Block SetBlock<T>(WrappedWorldPosition3i worldPos, PersistentChunk chunk = null, params object[] args)
    where T : Block
Parameters
Type Name Description
WrappedWorldPosition3i worldPos
PersistentChunk chunk
System.Object[] args
Returns
Type Description
Block
Type Parameters
Name Description
T

SetBlock<T>(WrappedWorldPosition3i, Object[])

Declaration
public Block SetBlock<T>(WrappedWorldPosition3i worldPos, params object[] args)
    where T : Block
Parameters
Type Name Description
WrappedWorldPosition3i worldPos
System.Object[] args
Returns
Type Description
Block
Type Parameters
Name Description
T

SetBlocks(IEnumerable<BlockChange>)

Declaration
public void SetBlocks(IEnumerable<BlockChange> blocks)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<BlockChange> blocks

Implements

INetObject
INetObjectPriority
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾