MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / setKey

Method setKey

src/Core/Animation/Animator.cpp:84–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void Animator::setKey(const std::string& key)
85 {
86 Debug::Log->trace("<Animator> Set Animation Key {0} for Animator at {1} {2}", key,
87 m_path.toString(), m_animations.size());
88 if (!m_animations.empty() && m_animations.find(key) == m_animations.end())
89 {
90 throw Exceptions::UnknownAnimation(
91 m_path.toString(), key, this->getAllAnimationName(), EXC_INFO);
92 }
93 if (key != this->getKey())
94 {
95 bool changeAnim = false;
96 if (m_currentAnimation != nullptr)
97 {
98 if (m_currentAnimation->isOver()
99 || m_animations[key]->getPriority()
100 >= m_currentAnimation->getPriority())
101 changeAnim = true;
102 }
103 else
104 changeAnim = true;
105 if (changeAnim)
106 {
107 if (m_currentAnimation)
108 m_currentAnimation->reset();
109 m_currentAnimation = m_animations[key].get();
110 }
111 }
112 }
113
114 void Animator::setPaused(bool pause) noexcept
115 {

Callers 1

loadGameObjectMethod · 0.80

Calls 13

getAllAnimationNameMethod · 0.95
getKeyMethod · 0.95
UnknownAnimationClass · 0.85
traceMethod · 0.80
getPriorityMethod · 0.80
toStringMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
isOverMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected