public enum CircuitType extends Enum<CircuitType>
true
represents the existence of another circuit part, false
no circuit part.
Enum Constant and Description |
---|
ANGLE_BOTTOM_LEFT
Angle bottom left ending.
|
ANGLE_BOTTOM_RIGHT
Angle bottom right ending.
|
ANGLE_TOP_LEFT
Angle top left ending.
|
ANGLE_TOP_RIGHT
Angle top right ending.
|
BLOCK
Block ending.
|
BOTTOM
Bottom ending.
|
HORIZONTAL
Horizontal rail.
|
LEFT
Left ending.
|
MIDDLE
Middle rail.
|
RIGHT
Right ending.
|
T3J_BOTTOM
Three way junction bottom ending.
|
T3J_LEFT
Three way junction left ending.
|
T3J_RIGHT
Three way junction right ending.
|
T3J_TOP
Three way junction top ending.
|
TOP
Top ending.
|
VERTICAL
Vertical rail.
|
Modifier and Type | Field and Description |
---|---|
static int |
BITS
Total bits number.
|
Modifier and Type | Method and Description |
---|---|
static CircuitType |
from(boolean[] binary)
Get the circuit part from its bits sequence.
|
static CircuitType |
from(boolean top,
boolean left,
boolean bottom,
boolean right)
Get the circuit part from its bits sequence.
|
static CircuitType |
from(String name)
Convert circuit part name to its enum value.
|
boolean |
getBottom()
Get bit at bottom.
|
boolean |
getLeft()
Get bit at left.
|
boolean |
getRight()
Get bit at right.
|
CircuitType |
getSymetric()
Get the symmetric circuit.
|
boolean |
getTop()
Get bit at top.
|
boolean |
is(boolean top,
boolean left,
boolean bottom,
boolean right)
Check if is the circuit part.
|
static CircuitType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CircuitType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CircuitType TOP
public static final CircuitType BOTTOM
public static final CircuitType LEFT
public static final CircuitType RIGHT
public static final CircuitType HORIZONTAL
public static final CircuitType VERTICAL
public static final CircuitType ANGLE_TOP_LEFT
public static final CircuitType ANGLE_TOP_RIGHT
public static final CircuitType ANGLE_BOTTOM_LEFT
public static final CircuitType ANGLE_BOTTOM_RIGHT
public static final CircuitType T3J_TOP
public static final CircuitType T3J_BOTTOM
public static final CircuitType T3J_LEFT
public static final CircuitType T3J_RIGHT
public static final CircuitType MIDDLE
public static final CircuitType BLOCK
public static final int BITS
public static CircuitType[] values()
for (CircuitType c : CircuitType.values()) System.out.println(c);
public static CircuitType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static CircuitType from(String name)
name
- The circuit part name.LionEngineException
- If invalid name.public static CircuitType from(boolean top, boolean left, boolean bottom, boolean right)
top
- The top right flag.left
- The left flag.bottom
- The bottom flag.right
- The right flag.public static CircuitType from(boolean[] binary)
binary
- The binary array (length must be equal to BITS
).LionEngineException
- If invalid array size.public CircuitType getSymetric()
public boolean is(boolean top, boolean left, boolean bottom, boolean right)
top
- The top right flag.left
- The left flag.bottom
- The bottom flag.right
- The right flag.true
if is circuit part, false
else.public boolean getTop()
public boolean getLeft()
public boolean getBottom()
public boolean getRight()
Copyright © 2016 Byron 3D Games Studio. All rights reserved.