-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathIBoolSyncValue.java
More file actions
37 lines (29 loc) · 962 Bytes
/
IBoolSyncValue.java
File metadata and controls
37 lines (29 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.cleanroommc.modularui.api.value.sync;
import com.cleanroommc.modularui.api.value.IBoolValue;
/**
* A helper interface for sync values which can be turned into an integer.
*
* @param <T> value type
*/
public interface IBoolSyncValue<T> extends IValueSyncHandler<T>, IBoolValue<T>, IIntSyncValue<T> {
@Override
default void setBoolValue(boolean val) {
setBoolValue(val, true, true);
}
default void setBoolValue(boolean val, boolean setSource) {
setBoolValue(val, setSource, true);
}
void setBoolValue(boolean value, boolean setSource, boolean sync);
@Override
default void setIntValue(int value, boolean setSource, boolean sync) {
setBoolValue(value == 1, setSource, sync);
}
@Override
default int getIntValue() {
return IBoolValue.super.getIntValue();
}
@Override
default void setIntValue(int val) {
IBoolValue.super.setIntValue(val);
}
}