Esempio n. 1
0
void ActionList::LoadFromS11nBlock(const ActionListS11nBlock& block)
{
	block.guid.GetValueIfExists(m_guid);

	if (block.name.Exists())
		m_name = pfc::stringcvt::string_wide_from_utf8(block.name.GetValue()).get_ptr();

	if (block.actions.Exists())
	{
		for (int i = 0; i < block.actions.GetSize(); ++i)
		{
			const ActionS11nBlock& actionBlock = block.actions.GetAt(i);

			// actionGUID is a required field, unnecessary to check if it exists.
			IAction* pPrototype = ServiceManager::Instance().GetActionPrototypesManager().
				GetPrototypeByGUID(actionBlock.actionGUID.GetValue());

			if (!pPrototype)
				continue;

			std::auto_ptr<IAction> pAction(pPrototype->Clone());
			pAction->LoadFromS11nBlock(actionBlock);

			m_actions.push_back(pAction);
		}
	}
}
Esempio n. 2
0
std::string ThrowDescription()
{
  static const std::string throwing = "Throwing exception in ";
  ActionDescriptionSequence sequence;
  pAction( sequence );
  return throwing + sequence.front()();
}
Esempio n. 3
0
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
I_Connection&
Event_impl::connectScript(boost::any _scriptObject, boost::any _scriptFunction)
{
    ScriptAction* pRawAction = new ScriptAction(m_service.getScriptObject()->getModule(),
            _scriptObject, _scriptFunction);

    pAction_type pAction(pRawAction, boost::bind(&Event_impl::destroyScriptAction, this, _1));

    return connect(pAction, &m_service.getEventQueue("script"));
}
Esempio n. 4
0
 void StoreActualAction()
 {
   if ( pAction == pThrowAction_ )
   {
     Throw< pAction >( actualSequence_ );
     throw TransitionTestException();
   }
   else
   {
     pAction( actualSequence_ );
   }
 }