mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Forgot to commit ConfigByteAttribute oops
This commit is contained in:
parent
565e428256
commit
758491931c
@ -52,6 +52,20 @@ namespace MCGalaxy.Config {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ConfigByteAttribute : ConfigIntAttribute {
|
||||
|
||||
public ConfigByteAttribute(string name, string section, string desc, int defValue,
|
||||
int min = byte.MinValue, int max = byte.MaxValue)
|
||||
: base(name, section, desc, defValue, min, max) {
|
||||
}
|
||||
|
||||
public override object Parse(string value) {
|
||||
int intValue = (int)base.Parse(value);
|
||||
return (byte)intValue; // Can't directly unbox object to byte - must unbox to int, then cast to byte
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ConfigBoolAttribute : ConfigAttribute {
|
||||
|
||||
public ConfigBoolAttribute(string name, string section, string desc, bool defValue)
|
||||
|
Loading…
x
Reference in New Issue
Block a user