C# Класс VoxelGame.Core.Logic.World

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetBlock BlockInstance?
GetContent System
GetLiquid LiquidInstance?
ModifyLiquid void
ModifyWorldData void
RetrieveContent void
SetBlock void
SetContent void
SetContent void
SetLiquid void
SetPosition void
Setup void
World System

Открытые методы

Метод Описание
Dispose ( ) : void

Dispose of the world.

DoRandomUpdate ( Vector3i position ) : bool

Force a random update at a position.

FinishAll ( ) : Task

Wait for all world tasks to finish.

GetSpawnPosition ( ) : Vector3

Get the spawn position of this world.

Save ( ) : Task

Saves all active chunks that are not currently saved.

SetDefaultBlock ( Vector3i position ) : void

Set a position to the default block.

SetDefaultLiquid ( Vector3i position ) : void

Set a position to the default liquid.

SetSpawnPosition ( Vector3 position ) : void

Sets the spawn position of this world.

Update ( float deltaTime ) : void

Called every update cycle.

Защищенные методы

Метод Описание
AddAllTasks ( List tasks ) : void

Add all tasks to the list. This is used to wait for all tasks to finish when calling FinishAll.

Dispose ( bool disposing ) : void

Dispose of the world.

ProcessChangedSection ( VoxelGame.Core.Logic.Chunk chunk, Vector3i position ) : void

Process that a section was changed.

World ( VoxelGame.Core.Logic.WorldInformation information, string path ) : System

This constructor is meant for worlds that already exist.

World ( string name, string path, int seed ) : System

This constructor is meant for worlds that are new.

Приватные методы

Метод Описание
GetBlock ( Vector3i position ) : BlockInstance?
GetContent ( Vector3i position ) : System
GetLiquid ( Vector3i position ) : LiquidInstance?
ModifyLiquid ( bool isStatic, Vector3i position ) : void
ModifyWorldData ( Vector3i position, uint clearMask, uint addMask ) : void
RetrieveContent ( Vector3i position, Block? &block, uint &data, Liquid? &liquid, LiquidLevel &level, bool &isStatic ) : void
SetBlock ( BlockInstance block, Vector3i position ) : void
SetContent ( Block block, uint data, VoxelGame.Core.Logic.Liquid liquid, LiquidLevel level, bool isStatic, Vector3i position, bool tickLiquid ) : void
SetContent ( BlockInstance block, LiquidInstance liquid, Vector3i position, bool tickLiquid ) : void
SetLiquid ( LiquidInstance liquid, Vector3i position ) : void
SetPosition ( Block block, uint data, VoxelGame.Core.Logic.Liquid liquid, LiquidLevel level, bool isStatic, Vector3i position ) : void
Setup ( ) : void
World ( VoxelGame.Core.Logic.WorldInformation information, string worldDirectory, string chunkDirectory, IWorldGenerator generator ) : System

Setup of readonly fields and non-optional steps.

Описание методов

AddAllTasks() защищенный Метод

Add all tasks to the list. This is used to wait for all tasks to finish when calling FinishAll.
protected AddAllTasks ( List tasks ) : void
tasks List The task list.
Результат void

Dispose() публичный Метод

Dispose of the world.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Dispose of the world.
protected Dispose ( bool disposing ) : void
disposing bool True when disposing intentionally.
Результат void

DoRandomUpdate() публичный Метод

Force a random update at a position.
public DoRandomUpdate ( Vector3i position ) : bool
position Vector3i The position.
Результат bool

FinishAll() публичный Метод

Wait for all world tasks to finish.
public FinishAll ( ) : Task
Результат Task

GetSpawnPosition() публичный Метод

Get the spawn position of this world.
public GetSpawnPosition ( ) : Vector3
Результат Vector3

ProcessChangedSection() защищенный абстрактный Метод

Process that a section was changed.
protected abstract ProcessChangedSection ( VoxelGame.Core.Logic.Chunk chunk, Vector3i position ) : void
chunk VoxelGame.Core.Logic.Chunk The chunk containing the section.
position Vector3i The position of the block that caused the section change.
Результат void

Save() публичный Метод

Saves all active chunks that are not currently saved.
public Save ( ) : Task
Результат Task

SetDefaultBlock() публичный Метод

Set a position to the default block.
public SetDefaultBlock ( Vector3i position ) : void
position Vector3i
Результат void

SetDefaultLiquid() публичный Метод

Set a position to the default liquid.
public SetDefaultLiquid ( Vector3i position ) : void
position Vector3i
Результат void

SetSpawnPosition() публичный Метод

Sets the spawn position of this world.
public SetSpawnPosition ( Vector3 position ) : void
position Vector3 The position to set as spawn.
Результат void

Update() публичный абстрактный Метод

Called every update cycle.
public abstract Update ( float deltaTime ) : void
deltaTime float The time since the last update cycle.
Результат void

World() защищенный Метод

This constructor is meant for worlds that already exist.
protected World ( VoxelGame.Core.Logic.WorldInformation information, string path ) : System
information VoxelGame.Core.Logic.WorldInformation
path string
Результат System

World() защищенный Метод

This constructor is meant for worlds that are new.
protected World ( string name, string path, int seed ) : System
name string
path string
seed int
Результат System