use of buildcraft.lib.expression.node.value.NodeConstantBoolean in project BuildCraft by BuildCraft.
the class NodeConditionalBoolean method inline.
@Override
public INodeBoolean inline() {
INodeBoolean c = condition.inline();
INodeBoolean t = ifTrue.inline();
INodeBoolean f = ifFalse.inline();
if (c instanceof NodeConstantBoolean) {
return ((NodeConstantBoolean) c).value ? t : f;
} else if (c != condition || t != ifTrue || f != ifFalse) {
return new NodeConditionalBoolean(c, t, f);
} else {
return this;
}
}
use of buildcraft.lib.expression.node.value.NodeConstantBoolean in project BuildCraft by BuildCraft.
the class NodeConditionalLong method inline.
@Override
public INodeLong inline() {
INodeBoolean c = condition.inline();
INodeLong t = ifTrue.inline();
INodeLong f = ifFalse.inline();
if (c instanceof NodeConstantBoolean && t instanceof NodeConstantLong && f instanceof NodeConstantLong) {
return new NodeConstantLong(((NodeConstantBoolean) c).value ? ((NodeConstantLong) t).value : ((NodeConstantLong) f).value);
} else if (c != condition || t != ifTrue || f != ifFalse) {
return new NodeConditionalLong(c, t, f);
} else {
return this;
}
}
use of buildcraft.lib.expression.node.value.NodeConstantBoolean in project BuildCraft by BuildCraft.
the class NodeConditionalDouble method inline.
@Override
public INodeDouble inline() {
INodeBoolean c = condition.inline();
INodeDouble t = ifTrue.inline();
INodeDouble f = ifFalse.inline();
if (c instanceof NodeConstantBoolean && t instanceof NodeConstantDouble && f instanceof NodeConstantDouble) {
return new NodeConstantDouble(((NodeConstantBoolean) c).value ? ((NodeConstantDouble) t).value : ((NodeConstantDouble) f).value);
} else if (c != condition || t != ifTrue || f != ifFalse) {
return new NodeConditionalDouble(c, t, f);
} else {
return this;
}
}
Aggregations