update logic functions to remove metatable OOP
This commit is contained in:
86
bricks/gen/newcode/Demux 2 Bit Vertical.cs
Normal file
86
bricks/gen/newcode/Demux 2 Bit Vertical.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
datablock fxDtsBrickData(LogicGate_Demux2Vertical_Data){
|
||||
brickFile = $LuaLogic::Path @ "bricks/gen/newbricks/Demux 2 Bit Vertical.blb";
|
||||
iconName = $LuaLogic::Path @ "bricks/gen/newicons/Demux 2 Bit Vertical";
|
||||
|
||||
category = "Logic Bricks";
|
||||
subCategory = "Mux";
|
||||
uiName = "Demux 2 Bit Vertical";
|
||||
logicUIName = "Demux 2 Bit Vertical";
|
||||
logicUIDesc = "";
|
||||
|
||||
hasPrint = 1;
|
||||
printAspectRatio = "Logic";
|
||||
|
||||
logicBrickSize = "1 1 4";
|
||||
orientationFix = 3;
|
||||
|
||||
isLogic = true;
|
||||
isLogicGate = true;
|
||||
isLogicInput = false;
|
||||
|
||||
logicInit =
|
||||
"return function(gate) " @
|
||||
" gate.laston = 3 " @
|
||||
"end"
|
||||
;
|
||||
logicInput = "";
|
||||
logicUpdate =
|
||||
"return function(gate) " @
|
||||
" if Gate.getportstate(gate, 7) then " @
|
||||
" local idx = 3 + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 1)] * 1) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 2)] * 2) " @
|
||||
" Gate.setportstate(gate, idx, true) " @
|
||||
" if gate.laston~=idx then " @
|
||||
" Gate.setportstate(gate, gate.laston, false) " @
|
||||
" gate.laston = idx " @
|
||||
" end " @
|
||||
" else " @
|
||||
" Gate.setportstate(gate, gate.laston, false) " @
|
||||
" end " @
|
||||
"end"
|
||||
;
|
||||
logicGlobal = "";
|
||||
|
||||
numLogicPorts = 7;
|
||||
|
||||
logicPortType[0] = 1;
|
||||
logicPortPos[0] = "0 0 -3";
|
||||
logicPortDir[0] = 3;
|
||||
logicPortUIName[0] = "Sel0";
|
||||
logicPortCauseUpdate[0] = true;
|
||||
|
||||
logicPortType[1] = 1;
|
||||
logicPortPos[1] = "0 0 -1";
|
||||
logicPortDir[1] = 3;
|
||||
logicPortUIName[1] = "Sel1";
|
||||
logicPortCauseUpdate[1] = true;
|
||||
|
||||
logicPortType[2] = 0;
|
||||
logicPortPos[2] = "0 0 -3";
|
||||
logicPortDir[2] = 1;
|
||||
logicPortUIName[2] = "Out0";
|
||||
|
||||
logicPortType[3] = 0;
|
||||
logicPortPos[3] = "0 0 -1";
|
||||
logicPortDir[3] = 1;
|
||||
logicPortUIName[3] = "Out1";
|
||||
|
||||
logicPortType[4] = 0;
|
||||
logicPortPos[4] = "0 0 1";
|
||||
logicPortDir[4] = 1;
|
||||
logicPortUIName[4] = "Out2";
|
||||
|
||||
logicPortType[5] = 0;
|
||||
logicPortPos[5] = "0 0 3";
|
||||
logicPortDir[5] = 1;
|
||||
logicPortUIName[5] = "Out3";
|
||||
|
||||
logicPortType[6] = 1;
|
||||
logicPortPos[6] = "0 0 -3";
|
||||
logicPortDir[6] = 5;
|
||||
logicPortUIName[6] = "In";
|
||||
logicPortCauseUpdate[6] = true;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user