Brick_LuaLogic/bricks/gen/newcode/Demux 2 Bit.cs

87 lines
1.8 KiB
C#

datablock fxDtsBrickData(LogicGate_Demux2_Data){
brickFile = $LuaLogic::Path @ "bricks/gen/newbricks/Demux 2 Bit.blb";
iconName = $LuaLogic::Path @ "bricks/gen/newicons/Demux 2 Bit";
category = "Logic Bricks";
subCategory = "Mux";
uiName = "Demux 2 Bit";
logicUIName = "Demux 2 Bit";
logicUIDesc = "";
hasPrint = 1;
printAspectRatio = "Logic";
logicBrickSize = "4 1 1";
orientationFix = 3;
isLogic = true;
isLogicGate = true;
isLogicInput = false;
logicInit =
"return function(gate) " @
" gate.laston = 3 " @
"end"
;
logicInput = "";
logicUpdate =
"return function(gate) " @
" if gate.ports[7].state then " @
" local idx = 3 + " @
" (gate.ports[1].state and 1 or 0) + " @
" (gate.ports[2].state and 2 or 0) " @
" gate.ports[idx]:setstate(true) " @
" if gate.laston~=idx then " @
" gate.ports[gate.laston]:setstate(false) " @
" gate.laston = idx " @
" end " @
" else " @
" gate.ports[gate.laston]:setstate(false) " @
" end " @
"end"
;
logicGlobal = "";
numLogicPorts = 7;
logicPortType[0] = 1;
logicPortPos[0] = "3 0 0";
logicPortDir[0] = 3;
logicPortUIName[0] = "Sel0";
logicPortCauseUpdate[0] = true;
logicPortType[1] = 1;
logicPortPos[1] = "1 0 0";
logicPortDir[1] = 3;
logicPortUIName[1] = "Sel1";
logicPortCauseUpdate[1] = true;
logicPortType[2] = 0;
logicPortPos[2] = "3 0 0";
logicPortDir[2] = 1;
logicPortUIName[2] = "Out0";
logicPortType[3] = 0;
logicPortPos[3] = "1 0 0";
logicPortDir[3] = 1;
logicPortUIName[3] = "Out1";
logicPortType[4] = 0;
logicPortPos[4] = "-1 0 0";
logicPortDir[4] = 1;
logicPortUIName[4] = "Out2";
logicPortType[5] = 0;
logicPortPos[5] = "-3 0 0";
logicPortDir[5] = 1;
logicPortUIName[5] = "Out3";
logicPortType[6] = 1;
logicPortPos[6] = "3 0 0";
logicPortDir[6] = 2;
logicPortUIName[6] = "In";
logicPortCauseUpdate[6] = true;
};