2020-05-17 18:13:45 +00:00
|
|
|
|
namespace GamecraftModdingAPI.Blocks
|
2020-01-03 00:14:26 +00:00
|
|
|
|
{
|
2020-05-17 18:13:45 +00:00
|
|
|
|
public struct BlockColor
|
|
|
|
|
{
|
|
|
|
|
public BlockColors Color;
|
|
|
|
|
public byte Darkness;
|
|
|
|
|
|
2020-06-04 22:20:35 +00:00
|
|
|
|
public BlockColor(byte index)
|
|
|
|
|
{
|
|
|
|
|
if (index == byte.MaxValue)
|
|
|
|
|
{
|
|
|
|
|
Color = BlockColors.Default;
|
|
|
|
|
Darkness = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Color = (BlockColors) (index % 10);
|
|
|
|
|
Darkness = (byte) (index / 10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BlockColor(BlockColors color, byte darkness)
|
|
|
|
|
{
|
|
|
|
|
Color = color;
|
|
|
|
|
Darkness = darkness;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-17 18:13:45 +00:00
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-04 00:54:35 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Preset block colours
|
|
|
|
|
/// </summary>
|
2020-01-03 00:14:26 +00:00
|
|
|
|
public enum BlockColors
|
|
|
|
|
{
|
|
|
|
|
Default = byte.MaxValue,
|
|
|
|
|
White = 0,
|
|
|
|
|
Pink,
|
|
|
|
|
Purple,
|
|
|
|
|
Blue,
|
|
|
|
|
Aqua,
|
|
|
|
|
Green,
|
|
|
|
|
Lime,
|
|
|
|
|
Yellow,
|
|
|
|
|
Orange,
|
|
|
|
|
Red
|
|
|
|
|
}
|
|
|
|
|
}
|