int WaitFrames::GetFrames(Agent* pAgent) const { if (this->m_frames_var) { BEHAVIAC_ASSERT(this->m_frames_var); TProperty<int>* pP = (TProperty<int>*)this->m_frames_var; uint64_t frames = pP->GetValue(pAgent); return (frames == ((uint64_t) - 1) ? -1 : (int)frames); } else if (this->m_frames_method) { Agent* pParent = Agent::GetInstance(pAgent, this->m_frames_method->GetInstanceNameString()); BEHAVIAC_ASSERT(pParent); this->m_frames_method->run(pParent, pAgent); int frames = this->m_frames_method->GetReturnValue<int>(pParent); return frames; } return 0; }
int WaitFramesState::GetFrames(Agent* pAgent) const { if (this->m_frames_var) { BEHAVIAC_ASSERT(this->m_frames_var); TProperty<int>* pP = (TProperty<int>*)this->m_frames_var; uint64_t frames = pP->GetValue(pAgent); return (frames == ((uint64_t)-1) ? -1 : (int)frames); } else if (this->m_frames_method) { //ParentType pt = this->m_frames_method->GetParentType(); Agent* pParent = pAgent; /*if (pt == PT_INSTANCE) {*/ pParent = Agent::GetInstance(this->m_frames_method->GetInstanceNameString(), pParent->GetContextId()); BEHAVIAC_ASSERT(pParent); /*}*/ this->m_frames_method->run(pParent, pAgent); int frames = this->m_frames_method->GetReturnValue<int>(pParent); return frames; } return 0; }
float Wait::GetTime(Agent* pAgent) const { if (this->m_time_var) { BEHAVIAC_ASSERT(this->m_time_var); TProperty<float>* pP = (TProperty<float>*)this->m_time_var; return pP->GetValue(pAgent); } return 0; }
int DecoratorWeight::GetWeight(behaviac::Agent* pAgent) const { if (this->m_weight_var) { BEHAVIAC_ASSERT(this->m_weight_var); TProperty<int>* pP = (TProperty<int>*)this->m_weight_var; uint64_t count = pP->GetValue(pAgent); return (count == ((uint64_t) - 1) ? -1 : (int)count); } return 0; }
int DecoratorCount::GetCount(Agent* pAgent) const { if (this->m_count_var) { BEHAVIAC_ASSERT(this->m_count_var); TProperty<int>* pP = (TProperty<int>*)this->m_count_var; uint64_t count = pP->GetValue(pAgent); return (count == ((uint64_t) - 1) ? -1 : (int)count); } return 0; }