C# 클래스 VoxelGame.Core.Logic.Block

상속: IBlockBase
파일 보기 프로젝트 열기: pershingthesecond/VoxelGame

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