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

Наследование: IBlockBase
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

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

Метод Описание
BlockUpdate ( World world, Vector3i position, data, BlockSide side ) : void

This method is called on blocks next to a position that was changed.

CanPlace ( World world, Vector3i position, PhysicsEntity? entity ) : bool

Override this to provide change the block placement checks.

Destroy ( World world, Vector3i position, PhysicsEntity? entity = null ) : bool

Attempt to destroy the block in the world. Will always fail if there is a different block at the given position.

EntityCollision ( PhysicsEntity entity, Vector3i position ) : void

This method is called when an entity collides with this block.

EntityInteract ( PhysicsEntity entity, Vector3i position ) : void

Called when a block and an entity collide.

GetBoundingBox ( World world, Vector3i position ) : BoundingBox

Returns the bounding box of this block if it would be at the given position.

GetMesh ( BlockMeshInfo info ) : BlockMeshData

Returns the mesh of a block side at given conditions.

Place ( World world, Vector3i position, PhysicsEntity? entity = null ) : bool

Attempt to place the block in the world.

RandomUpdate ( World world, Vector3i position, data ) : void

This method is called randomly on some blocks every update.

ToString ( ) : string

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

Метод Описание
Block ( string name, string namedId, BlockFlags flags, BoundingBox boundingBox, TargetBuffer targetBuffer ) : System.Diagnostics

Create a new block.

CanDestroy ( World world, Vector3i position, data, PhysicsEntity? entity ) : bool

Override this to change the block destruction checks.

DoDestroy ( World world, Vector3i position, data, PhysicsEntity? entity ) : void

Override this to change the block destruction logic. The block destruction must always be successful. If checks are required, override CanDestroy.

DoPlace ( World world, Vector3i position, PhysicsEntity? entity ) : void

Override this to change the block placement logic. The block placement must always be successful. If checks are required, override CanPlace.

EntityCollision ( PhysicsEntity entity, Vector3i position, data ) : void

Override to provide custom entity collision logic.

EntityInteract ( PhysicsEntity entity, Vector3i position, data ) : void

Override to provide custom entity interaction logic.

GetBoundingBox ( data ) : BoundingBox

Override this to provide a custom bounding box for this block, depending on the block data.

ScheduledUpdate ( World world, Vector3i position, data ) : void

This method is called for scheduled updates.

Setup ( ITextureIndexProvider indexProvider ) : void

Called when loading blocks, meant to setup vertex data, indices etc.

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

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

Create a new block.
protected Block ( string name, string namedId, BlockFlags flags, BoundingBox boundingBox, TargetBuffer targetBuffer ) : System.Diagnostics
name string The name of the block. Can be localized.
namedId string The named ID of the block. A unique and unlocalized identifier.
flags BlockFlags The block flags setting specific options.
boundingBox BoundingBox The base bounding box for this block. Is used for placement checks.
targetBuffer TargetBuffer The target rendering buffer.
Результат System.Diagnostics

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

This method is called on blocks next to a position that was changed.
public BlockUpdate ( World world, Vector3i position, data, BlockSide side ) : void
world World The containing world.
position Vector3i The block position.
data The data of the block next to the changed position.
side BlockSide The side of the block where the change happened.
Результат void

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

Override this to change the block destruction checks.
protected CanDestroy ( World world, Vector3i position, data, PhysicsEntity? entity ) : bool
world World The world in which the placement occurs.
position Vector3i The position at which the placement is requested.
data The block data.
entity PhysicsEntity? The entity that performs placement.
Результат bool

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

Override this to provide change the block placement checks.
public CanPlace ( World world, Vector3i position, PhysicsEntity? entity ) : bool
world World The world in which the placement occurs.
position Vector3i The position at which the placement is requested.
entity PhysicsEntity? The entity that performs placement.
Результат bool

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

Attempt to destroy the block in the world. Will always fail if there is a different block at the given position.
public Destroy ( World world, Vector3i position, PhysicsEntity? entity = null ) : bool
world World The world in which to destroy the block.
position Vector3i The position at which to destroy to block.
entity PhysicsEntity? The entity destroying the block.
Результат bool

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

Override this to change the block destruction logic. The block destruction must always be successful. If checks are required, override CanDestroy.
protected DoDestroy ( World world, Vector3i position, data, PhysicsEntity? entity ) : void
world World The world in which the placement occurs.
position Vector3i The position at which the placement is requested.
data The block data.
entity PhysicsEntity? The entity that performs placement.
Результат void

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

Override this to change the block placement logic. The block placement must always be successful. If checks are required, override CanPlace.
protected DoPlace ( World world, Vector3i position, PhysicsEntity? entity ) : void
world World The world in which the placement occurs.
position Vector3i The position at which the placement is requested.
entity PhysicsEntity? The entity that performs placement.
Результат void

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

This method is called when an entity collides with this block.
public EntityCollision ( PhysicsEntity entity, Vector3i position ) : void
entity PhysicsEntity The entity that caused the collision.
position Vector3i The block position.
Результат void

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

Override to provide custom entity collision logic.
protected EntityCollision ( PhysicsEntity entity, Vector3i position, data ) : void
entity PhysicsEntity The entity that collided with this block.
position Vector3i The position of the block.
data The block data of this block.
Результат void

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

Called when a block and an entity collide.
public EntityInteract ( PhysicsEntity entity, Vector3i position ) : void
entity PhysicsEntity The entity that collided with the block.
position Vector3i The block position.
Результат void

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

Override to provide custom entity interaction logic.
protected EntityInteract ( PhysicsEntity entity, Vector3i position, data ) : void
entity PhysicsEntity The entity that interacted with this block.
position Vector3i The position of the block.
data The block data of this block.
Результат void

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

Override this to provide a custom bounding box for this block, depending on the block data.
protected GetBoundingBox ( data ) : BoundingBox
data The block data.
Результат BoundingBox

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

Returns the bounding box of this block if it would be at the given position.
public GetBoundingBox ( World world, Vector3i position ) : BoundingBox
world World The world in which the block is.
position Vector3i The position of the block.
Результат BoundingBox

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

Returns the mesh of a block side at given conditions.
public abstract GetMesh ( BlockMeshInfo info ) : BlockMeshData
info BlockMeshInfo Information about the conditions the mesh should be created in.
Результат BlockMeshData

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

Attempt to place the block in the world.
public Place ( World world, Vector3i position, PhysicsEntity? entity = null ) : bool
world World The world in which to place the block.
position Vector3i The position at which to place the block.
entity PhysicsEntity? The entity that is placing the block.
Результат bool

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

This method is called randomly on some blocks every update.
public RandomUpdate ( World world, Vector3i position, data ) : void
world World
position Vector3i
Результат void

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

This method is called for scheduled updates.
protected ScheduledUpdate ( World world, Vector3i position, data ) : void
world World
position Vector3i
Результат void

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

Called when loading blocks, meant to setup vertex data, indices etc.
protected Setup ( ITextureIndexProvider indexProvider ) : void
indexProvider ITextureIndexProvider
Результат void

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

public final ToString ( ) : string
Результат string