mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Geometry Generation now in Block
This commit is contained in:
@@ -1,20 +1,40 @@
|
||||
using GlitchyEngine.Math;
|
||||
using GlitchyEngine;
|
||||
namespace Sandbox.VoxelFun
|
||||
{
|
||||
class Block
|
||||
{
|
||||
private Model _model;
|
||||
|
||||
private uint16 _blockID;
|
||||
|
||||
public uint16 ID => _blockID;
|
||||
|
||||
public Color Color {get;}
|
||||
public Model Model => _model;
|
||||
|
||||
public BlockFace VisibleNeighbors {get;}
|
||||
|
||||
public this(Color color, BlockFace visibleNeighbors = .None)
|
||||
public this(BlockFace visibleNeighbors = .None)
|
||||
{
|
||||
Color = color;
|
||||
VisibleNeighbors = visibleNeighbors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called when the block is being destroyed by the player.
|
||||
* @param blockCoordinate The coordinate the block is at.
|
||||
*/
|
||||
public virtual void OnBreaking(Int32_3 blockCoordinate)
|
||||
{
|
||||
Log.ClientLogger.Info($"I broke. {{{blockCoordinate}}}");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called when the block is being placed by the player.
|
||||
* @param blockCoordinate The coordinate the block is at.
|
||||
*/
|
||||
public virtual void OnPlacing(Int32_3 blockCoordinate)
|
||||
{
|
||||
Log.ClientLogger.Info($"I broke. {{{blockCoordinate}}}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user