LeviLamina
Loading...
Searching...
No Matches
BaseCircuitComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/RefCountedSet.h"
7#include "mc/world/level/BlockPos.h"
8#include "mc/world/redstone/circuit/components/CircuitComponentList.h"
9#include "mc/world/redstone/circuit/components/CircuitComponentType.h"
10#include "mc/world/redstone/circuit/components/RedstoneLogicExecutionFlags.h"
11
12// auto generated forward declare list
13// clang-format off
15class CircuitSystem;
17// clang-format on
18
20public:
21 // member variables
22 // NOLINTBEGIN
23 ::ll::TypedStorage<8, 24, ::CircuitComponentList> mSources;
24 ::ll::TypedStorage<8, 16, ::Core::RefCountedSet<::BaseCircuitComponent*>> mDestinations;
25 ::ll::TypedStorage<1, 1, bool> mIgnoreFirstUpdate;
26 ::ll::TypedStorage<1, 1, bool> mIsFirstTime;
27 ::ll::TypedStorage<1, 1, bool> mNeedsUpdate;
28 ::ll::TypedStorage<4, 12, ::BlockPos> mPos;
29 ::ll::TypedStorage<4, 12, ::BlockPos> mChunkPosition;
30 ::ll::TypedStorage<1, 1, bool> mShouldEvaluate;
31 ::ll::TypedStorage<2, 2, short> mStrength;
32 ::ll::TypedStorage<2, 2, short> mOldStrength;
33 ::ll::TypedStorage<1, 1, uchar> mDirection;
34 ::ll::TypedStorage<1, 1, bool> mAllowPowerUp;
35 ::ll::TypedStorage<1, 1, bool> mAllowPowerDown;
36 ::ll::TypedStorage<1, 1, bool> mRemoved;
37 ::ll::TypedStorage<1, 1, bool> mConsumePowerAnyDirection;
38 ::ll::TypedStorage<8, 8, ::CircuitComponentType> mCircuitComponentType;
39 // NOLINTEND
40
41public:
42 // virtual functions
43 // NOLINTBEGIN
44 virtual ~BaseCircuitComponent();
45
46 virtual int getStrength() const;
47
48 virtual int getDirection() const;
49
50 virtual void setOldStrength(short strength);
51
52 virtual void setStrength(int strength);
53
54 virtual void setDirection(uchar direction);
55
56 virtual void setConsumePowerAnyDirection(bool canConsumePowerAnyDirection);
57
58 virtual bool canConsumePowerAnyDirection() const;
59
60 virtual bool canConsumerPower() const;
61
62 virtual bool canStopPower() const;
63
64 virtual void setStopPower(bool bPower);
65
66 virtual bool needsUpdate();
67
68 virtual void removeSource(::BlockPos const& posSource, ::BaseCircuitComponent const* pComponent);
69
70 virtual bool
71 addSource(::CircuitSceneGraph& graph, ::CircuitTrackingInfo const& info, int& dampening, bool& bDirectlyPowered);
72
73 virtual bool allowConnection(::CircuitSceneGraph& graph, ::CircuitTrackingInfo const& info, bool& bDirectlyPowered);
74
75 virtual void checkLock(::CircuitSystem& system, ::BlockPos const& pos);
76
77 virtual bool evaluate(::CircuitSystem& system, ::BlockPos const& pos);
78
79 virtual void cacheValues(::CircuitSystem& system, ::BlockPos const& pos);
80
81 virtual void updateDependencies(::CircuitSceneGraph& system, ::BlockPos const& pos);
82
83 virtual ::RedstoneLogicExecutionFlags getLogicExecutionFlags() const;
84
85 virtual bool allowIndirect() const;
86
87 virtual bool isHalfPulse() const;
88
89 virtual bool hasSource(::BaseCircuitComponent const& source) const;
90
91 virtual bool hasChildrenSource() const;
92
93 virtual bool isSecondaryPowered() const;
94
95 virtual void removeFromAnySourceList(::BaseCircuitComponent const* component);
96
97 virtual ::CircuitComponentType getCircuitComponentType() const;
98
99 virtual ::CircuitComponentType getCircuitComponentGroupType() const;
100 // NOLINTEND
101
102public:
103 // member functions
104 // NOLINTBEGIN
105 MCAPI void addSourceItem(::CircuitComponentList::Item const& item);
106
107 MCAPI bool trackPowerSource(
108 ::CircuitTrackingInfo const& info,
109 int dampening,
110 bool directlyPowered,
111 int data,
112 bool isDirectional
113 );
114 // NOLINTEND
115
116public:
117 // destructor thunk
118 // NOLINTBEGIN
119 MCAPI void $dtor();
120 // NOLINTEND
121
122public:
123 // virtual function thunks
124 // NOLINTBEGIN
125 MCFOLD int $getStrength() const;
126
127 MCAPI int $getDirection() const;
128
129 MCAPI void $setOldStrength(short strength);
130
131 MCAPI void $setStrength(int strength);
132
133 MCAPI void $setDirection(uchar direction);
134
135 MCAPI void $setConsumePowerAnyDirection(bool canConsumePowerAnyDirection);
136
137 MCAPI bool $canConsumePowerAnyDirection() const;
138
139 MCFOLD bool $canConsumerPower() const;
140
141 MCFOLD bool $canStopPower() const;
142
143 MCFOLD void $setStopPower(bool bPower);
144
145 MCAPI bool $needsUpdate();
146
147 MCAPI void $removeSource(::BlockPos const& posSource, ::BaseCircuitComponent const* pComponent);
148
149 MCFOLD bool
150 $addSource(::CircuitSceneGraph& graph, ::CircuitTrackingInfo const& info, int& dampening, bool& bDirectlyPowered);
151
152 MCFOLD bool $allowConnection(::CircuitSceneGraph& graph, ::CircuitTrackingInfo const& info, bool& bDirectlyPowered);
153
154 MCFOLD void $checkLock(::CircuitSystem& system, ::BlockPos const& pos);
155
156 MCFOLD bool $evaluate(::CircuitSystem& system, ::BlockPos const& pos);
157
158 MCFOLD void $cacheValues(::CircuitSystem& system, ::BlockPos const& pos);
159
160 MCFOLD void $updateDependencies(::CircuitSceneGraph& system, ::BlockPos const& pos);
161
162 MCFOLD ::RedstoneLogicExecutionFlags $getLogicExecutionFlags() const;
163
164 MCFOLD bool $allowIndirect() const;
165
166 MCFOLD bool $isHalfPulse() const;
167
168 MCAPI bool $hasSource(::BaseCircuitComponent const& source) const;
169
170 MCFOLD bool $hasChildrenSource() const;
171
172 MCFOLD bool $isSecondaryPowered() const;
173
174 MCAPI void $removeFromAnySourceList(::BaseCircuitComponent const* component);
175
176 MCFOLD ::CircuitComponentType $getCircuitComponentType() const;
177
178 MCAPI ::CircuitComponentType $getCircuitComponentGroupType() const;
179
180
181 // NOLINTEND
182
183public:
184 // vftables
185 // NOLINTBEGIN
186 MCAPI static void** $vftable();
187 // NOLINTEND
188};
Definition BaseCircuitComponent.h:19
Definition BlockPos.h:19
Definition CircuitComponentList.h:22
Definition CircuitSceneGraph.h:18
Definition CircuitSystem.h:15
Definition CircuitTrackingInfo.h:14