Example #1
0
bool Role::changeState(RoleActionState state){
	bool bRet = false;
	do{
		CC_BREAK_IF(getCurState() == state);
		bRet = true;
		setCurState(state);
	} while (false);
	return bRet;
}
Example #2
0
int SMFsm::msgProc(MESSAGE *pMsg, int *userId)
{
    qDebug() << "SMFsm::msgproc";
    State *pState = getCurState();
    int rc = pState->msgProc(this,pMsg,userId);
    int currentIndex = getCurStateIndex();
    pState->stateProc(currentIndex);
    // Access the parent's public varible directly is not a good idea, we need to disscurss this issue
    //I hanve change these variables to private
    return FSM::HANDLE_NO_END;
}