Refactor enums to classes with static fields

This commit is contained in:
SpaiR committed 2019-12-29 23:59:39 +03:00
1 parent d4c59568d7
commit 8d241a60e6
35 files changed
+551 -769

No files matched your search

+19 -4
View File
@@ -1,5 +1,7 @@
package imgui;
import java.util.Objects;
public class ImShort {
short[] data = new short[]{0};
@@ -7,19 +9,32 @@ public class ImShort {
}
public ImShort(short value) {
setValue(value);
set(value);
}
public short getValue() {
public short get() {
return this.data[0];
}
public void setValue(short value) {
public void set(short value) {
this.data[0] = value;
}
@Override
public String toString() {
return String.valueOf(getValue());
return String.valueOf(get());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ImShort imShort = (ImShort) o;
return data[0] == imShort.data[0];
}
@Override
public int hashCode() {
return Objects.hashCode(data[0]);
}
}