Mekanism-tilera-Edition/common/cofh/api/tileentity/ISecureTile.java
2013-11-14 21:58:32 -05:00

44 lines
952 B
Java

package cofh.api.tileentity;
public interface ISecureTile {
public static enum AccessMode {
PUBLIC, RESTRICTED, PRIVATE;
public boolean isPublic() {
return this == PUBLIC;
}
public boolean isRestricted() {
return this == RESTRICTED;
}
public boolean isPrivate() {
return this == PRIVATE;
}
public static AccessMode stepForward(AccessMode curAccess) {
return curAccess == AccessMode.PUBLIC ? AccessMode.RESTRICTED : curAccess == AccessMode.PRIVATE ? AccessMode.PUBLIC : AccessMode.PRIVATE;
}
public static AccessMode stepBackward(AccessMode curAccess) {
return curAccess == AccessMode.PUBLIC ? AccessMode.PRIVATE : curAccess == AccessMode.PRIVATE ? AccessMode.RESTRICTED : AccessMode.PUBLIC;
}
}
public boolean setAccess(AccessMode access);
public AccessMode getAccess();
public boolean setOwnerName(String name);
public String getOwnerName();
public boolean canPlayerAccess(String name);
}