#include "StdAfx.h" #include "StrategyMinAnswer.h" #include "Agent.h" #include "AgentGroup.h" CStrategyMinAnswer::CStrategyMinAnswer(void) { } CStrategyMinAnswer::~CStrategyMinAnswer(void) { } /***************************************************************** **【函数名称】 _locateAgent **【函数功能】 得到当前排队策略下可用座席 **【参数】 **【返回值】 ****************************************************************/ CAgent* CStrategyMinAnswer::_locateAgent( CAgentGroup& AgentGroup ) { UINT nMinAnswerCount = 99999; CAgent* pAgentRet = NULL; for(int i = 0; i < AgentGroup.GetCount(); ++i) { CAgent* pAgent = AgentGroup[i]; if(pAgent->answerCount() < nMinAnswerCount && pAgent->isFree()) { pAgentRet = pAgent; nMinAnswerCount = pAgentRet->answerCount(); } // end if } return pAgentRet; }