MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / update

Method update

Source/Platformer/Unit.cpp:206–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206bool Unit::update(double deltaTime) {
207 if (_flags.isOff(Node::Updating)) {
208 return Body::update(deltaTime);
209 }
210 if (_currentAction) {
211 if (_currentAction->isDoing()) {
212 _currentAction->update(s_cast<float>(deltaTime));
213 if (_currentAction) {
214 if (_currentAction->isDoing()) {
215 _currentAction->_status = Behavior::Status::Running;
216 } else {
217 _currentAction->_status = Behavior::Status::Success;
218 _currentAction = nullptr;
219 }
220 }
221 } else {
222 _currentAction->_status = Behavior::Status::Success;
223 _currentAction = nullptr;
224 }
225 } else {
226 SharedAI.runDecisionTree(this);
227 }
228 if (_behaviorTree) {
229 _blackboard->setDeltaTime(deltaTime);
230 auto status = _behaviorTree->tick(_blackboard.get());
231 if (status != Behavior::Status::Running) {
232 _blackboard->clear();
233 _behaviorTree = nullptr;
234 }
235 }
236 return Body::update(deltaTime);
237}
238
239void Unit::cleanup() {
240 if (_flags.isOff(Node::Cleanup)) {

Callers

nothing calls this directly

Calls 8

isOffMethod · 0.80
runDecisionTreeMethod · 0.80
setDeltaTimeMethod · 0.80
tickMethod · 0.80
getMethod · 0.65
clearMethod · 0.65
updateFunction · 0.50
isDoingMethod · 0.45

Tested by

no test coverage detected