void ServerModel::QueueAction(ActionPtr spAction)
{
   // resolve argument
   ObjectRef& ref = spAction->ArgumentRef();
   if (ref.m_sp == NULL)
      ref.m_sp = m_objectMap.FindObject(ref.m_id).m_sp;

   spAction->Do(*this);
}
示例#2
0
///**********************************************************************///
///                       class implement end                            ///
///**********************************************************************///
///**********************************************************************///
///                       class implement begin                          ///
///**********************************************************************///
void Robot::RunOnce()
{
	ActionQueue::iterator iter = m_actionQueue.begin();
	ActionQueue::iterator end = m_actionQueue.end();
	for (; iter != end; iter++) {
		ActionPtr act = *iter;
		act->Do();
		CommandProc();
	}
	CommandProc();
}
   /// executes action
   void Execute(ActionPtr spAction)
   {
      ObjectRef& arg = spAction->ArgumentRef();
      ATLASSERT(arg.m_sp != NULL);

      {
         // lock argument ref
         Lockable::LockType lock = arg.m_sp->Lock();
         spAction->Do(m_model);
      }
   }
示例#4
0
文件: robot.cpp 项目: vengine/XGC
void Robot::DoAction() {
	ActionPtr act = GetCurrnetAction();
	if (act.get()) act->Do();
	Next();
	CommandProc();
}