HUDManager/HUD Manager/Structs/Options/HotbarOptions.cs

43 lines
1.2 KiB
C#
Executable File

namespace HUD_Manager.Structs.Options {
public class HotbarOptions {
private readonly byte[] _options;
public byte Index {
get => this._options[0];
set => this._options[0] = value;
}
public HotbarLayout Layout {
get => (HotbarLayout) this._options[1];
set => this._options[1] = (byte) value;
}
public HotbarOptions(byte[] options) {
this._options = options;
}
}
public enum HotbarLayout : byte {
TwelveByOne = 1,
SixByTwo = 2,
FourByThree = 3,
ThreeByFour = 4,
TwoBySix = 5,
OneByTwelve = 6,
}
public static class HotbarLayoutExt {
public static string Name(this HotbarLayout layout) {
return layout switch {
HotbarLayout.TwelveByOne => "12x1",
HotbarLayout.SixByTwo => "6x2",
HotbarLayout.FourByThree => "4x3",
HotbarLayout.ThreeByFour => "3x4",
HotbarLayout.TwoBySix => "2x6",
HotbarLayout.OneByTwelve => "1x12",
_ => layout.ToString(),
};
}
}
}