Exemplo n.º 1
0
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);
}
Exemplo n.º 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);
      }
   }
Exemplo n.º 4
0
void Robot::DoAction() {
	ActionPtr act = GetCurrnetAction();
	if (act.get()) act->Do();
	Next();
	CommandProc();
}