Files
Mindustry/core/src/mindustry/logic/LAccess.java
2020-10-05 15:42:37 -04:00

57 lines
1.1 KiB
Java

package mindustry.logic;
import arc.struct.*;
/** Setter/getter enum for logic-controlled objects. */
public enum LAccess{
totalItems,
totalLiquids,
totalPower,
itemCapacity,
liquidCapacity,
powerCapacity,
powerNetStored,
powerNetCapacity,
powerNetIn,
powerNetOut,
health,
maxHealth,
heat,
efficiency,
rotation,
x,
y,
shootX,
shootY,
shooting,
team,
type,
flag,
name,
//values with parameters are considered controllable
enabled("to"), //"to" is standard for single parameter access
shoot("x", "y", "shoot"),
shootp(true, "unit", "shoot")
;
public final String[] params;
public final boolean isObj;
public static final LAccess[]
all = values(),
senseable = Seq.select(all, t -> t.params.length <= 1).toArray(LAccess.class),
controls = Seq.select(all, t -> t.params.length > 0).toArray(LAccess.class);
LAccess(String... params){
this.params = params;
isObj = false;
}
LAccess(boolean obj, String... params){
this.params = params;
isObj = obj;
}
}