mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
42 lines
916 B
Beef
42 lines
916 B
Beef
using GlitchyEngine;
|
|
using GlitchyEngine.Math;
|
|
|
|
namespace Sandbox.VoxelFun
|
|
{
|
|
class Block
|
|
{
|
|
private Model _model;
|
|
|
|
private uint16 _blockID;
|
|
|
|
public uint16 ID => _blockID;
|
|
|
|
public Model Model => _model;
|
|
|
|
public BlockFace VisibleNeighbors {get;}
|
|
|
|
public this(BlockFace visibleNeighbors = .None)
|
|
{
|
|
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 live! {{{blockCoordinate}}}");
|
|
}
|
|
}
|
|
}
|