当前位置: 首页>>代码示例>>C++>>正文


C++ EventData类代码示例

本文整理汇总了C++中EventData的典型用法代码示例。如果您正苦于以下问题:C++ EventData类的具体用法?C++ EventData怎么用?C++ EventData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: idlewait

void idlewait(Renderer* renderer, Window& window, Callback cb)
{
    EventData e;
    while (true) {
        event::wait(e);
        cb(e);
        if (e.type() == EventType::Quit) {
            break;
        } else if (e.type() == EventType::Window) {
            auto p = e.acquire<EventType::Window>();
            switch (p.getID()) {
                case SDL_WINDOWEVENT_EXPOSED:
                    if (renderer) {
                        renderer->present();
                    } else {
                        window.update();
                    }
                    if (maxmin) {
                        maxmin = true;
                        window.restore();
                    }
                    break;
                case SDL_WINDOWEVENT_MAXIMIZED:
                case SDL_WINDOWEVENT_MINIMIZED:
                    maxmin = true;
                    break;
                default:
                    break;
            }
        }
    }
}
开发者ID:suxue,项目名称:sdlpp,代码行数:32,代码来源:common.cpp

示例2: SendEvent

ReturnType KinectComp::SendEvent( const KinectEvent& event )
{
	EventData<KinectEvent> eventData;
	eventData.setId("KinectEvent");
	eventData.setContentData(event);

	return mKinectOutputEvent.push(&eventData);
}
开发者ID:OPRoS,项目名称:Component,代码行数:8,代码来源:KinectComp.cpp

示例3: showEvent

void EventsWindow::showEvent(const QModelIndex &index)
{
    EventData *data = index.data(EventsModel::EventDataPtr).value<EventData*>();
    showEvent(*data);

    m_modelEventsCursor->setCameraFilter(data->locationCamera());
    m_modelEventsCursor->setIndex(index.row());
}
开发者ID:chenbk85,项目名称:bluecherry-client,代码行数:8,代码来源:EventsWindow.cpp

示例4: HandleEvent

//Process possible events
bool BodyChainAgent::HandleEvent(const EventData& data)
{
	bool eventprocessed(false);

	if(!mActive)
		return false;

	//IF - A Monkey attached
	if(data.GetEventType() == Event_MonkeyAttached)
	{
		const MonkeyAttachedEvent& eventdata (static_cast<const MonkeyAttachedEvent&>(data));
		
		//IF - Attached to this agent
		if(eventdata.GetAgentId() == mId)
		{
			//Find branch (bodychain)
			BodyChain::BodyChainListIterator itr;
			std::string bodychainid (eventdata.GetBodyChainId());
			//LOOP - Find the affected bodychain list
			for(itr = mParams.bodychainlist.begin();itr != mParams.bodychainlist.end();++itr)
			{
				//IF - Found
				if((*itr)->GetId() == bodychainid)
				{
					(*itr)->IncrementAttached();
				}//IF
			}//LOOP
		}//IF

	}//ELSE - A Monkey detached
	else if(data.GetEventType() == Event_MonkeyDetached)
	{
		const MonkeyDetachedEvent& eventdata (static_cast<const MonkeyDetachedEvent&>(data));
		
		//IF - Attached to this agent
		if(eventdata.GetAgentId() == mId)
		{
			//Find branch (bodychain)
			BodyChain::BodyChainListIterator itr;
			std::string bodychainid (eventdata.GetBodyChainId());
			//LOOP - Find the affected bodychain list
			for(itr = mParams.bodychainlist.begin();itr != mParams.bodychainlist.end();++itr)
			{
				//IF - Found
				if((*itr)->GetId() == bodychainid)
				{
					(*itr)->DecrementAttached();
				}//IF
			}//LOOP
		}//IF
	}//IF

	return eventprocessed;
}
开发者ID:DarthMike,项目名称:Monkey-Madness,代码行数:55,代码来源:BodyChainAgent.cpp

示例5: ASSERT

/*---------------------------------------------------------------------*//**
	シリアライズ
**//*---------------------------------------------------------------------*/
bool StoryManager::serialize(Serializer* ser) const
{
	// 実行中の Act イベント ID を得る
	u16 evidActing = 0;
	EventData* evdat = Game::getGame()->getEventSys()->getEventData();	ASSERT(evdat != 0L);
	for(int imat = 0; imat < evdat->getEventMatterNum(); imat++)
	{
		EventMatter* matterWk = evdat->getEventMatter(imat);
		if((matterWk->getMatterType() == EMTYPE_ACT) && matterWk->isBegin())	// 開始済み ActMatter 判定
		{
			evidActing = matterWk->getEvId();
		}
	}

	// ストーリーの保存
	if(ser->isStructureMode())	// ストラクチャモード
	{
		SaveStructure* svst = (SaveStructure*)ser->getStructure();
		svst->_gamesvst._storyid = _storyid;										// ストーリー ID の書き込み
		svst->_gamesvst._isPlayedStoryStartupEvent = _isPlayedStoryStartupEvent;	// ストーリー開始イベント起動フラグの書き込み
		svst->_gamesvst._evidActing = evidActing;									// 実行中の Act イベント ID の書き込み
	}
	else						// ダイレクトモード
	{
		ser->store(&_storyid);						// ストーリー ID の書き込み
		ser->store(&_isPlayedStoryStartupEvent);	// ストーリー開始イベント起動フラグの書き込み
		ser->store(&evidActing);					// 実行中の Act イベント ID の書き込み
	}

	// 配置オブジェクトの状態を保存する
	if(ser->isStructureMode())	// ストラクチャモード
	{
		SaveStructure* svst = (SaveStructure*)ser->getStructure();
		if(!svst->storePlacementObjData(_listPlaceObj))
		{
			return false;
		}
	}
	else						// ダイレクトモード
	{
		s32 numPobj = _listPlaceObj->getCount();
		ser->store(&numPobj);
		for(ListIterator<PlacementObj*> it = _listPlaceObj->iterator(); it.has(); it.next())
		{
			const PlacementObj* pobj = it.object();
			pobj->serialize(ser);
		}
	}

	// ワールドマップのシリアライズ
	_wmap->serialize(ser);

	return true;
}
开发者ID:Altoterras,项目名称:TheHeartOfSourcerer,代码行数:57,代码来源:StoryManager.cpp

示例6: ASSERT

/*---------------------------------------------------------------------*//**
	動作停止
**//*---------------------------------------------------------------------*/
void Mcut::stop(ActMatter* owner)
{
	EventData* evdat = owner->getEventSystemRefer()->getEventData(); ASSERT(evdat != 0L);

	// マターを削除する
	if(_evid != 0)
	{
		evdat->removeMatter(_evid);
		_evid = 0;
	}

	Act::stop(owner);
}
开发者ID:Altoterras,项目名称:TheHeartOfSourcerer,代码行数:16,代码来源:Mcut.cpp

示例7: handleEvent

bool EventSnooper::handleEvent(EventData const &eventData)
{

#ifdef _DEBUG
	if (mOutFile)
	{
		fprintf_s(mOutFile, "Event Snoop: Event %p Time: %f Type: %s \n", &eventData, eventData.getTimeStamp(), eventData.getEventType().getStr().c_str());
	}

	DEBUG_MESSAGE("Event Snoop: Event " << &eventData << " Time: " << eventData.getTimeStamp() <<  " type: " << eventData.getEventType().getStr());
#endif

	return false;
}
开发者ID:GustavPersson,项目名称:miniature-dubstep,代码行数:14,代码来源:snooper.cpp

示例8: ASSERT

/*---------------------------------------------------------------------*//**
	動作開始
**//*---------------------------------------------------------------------*/
void ScrEff::play(ActMatter* owner)
{
	EventData* evdat = owner->getEventSystemRefer()->getEventData(); ASSERT(evdat != 0L);

	// スクリーンエフェクト開始
	_evid = evdat->addChildMatter(owner->getEvId(), "SCREFF"); ASSERT(_evid != 0);
	ScrEffMatter* matter = (ScrEffMatter*)evdat->getMatterFromEvid(_evid); ASSERT(matter != 0L);
	matter->setting(&_setting);	// 動作設定
	// イベント開始
	EvCause evcause(EventCause::CID_ACT);
	owner->getEventSystemRefer()->begin(_evid, owner->getBeginParam(), &evcause);

	Act::play(owner);
}
开发者ID:Altoterras,项目名称:TheHeartOfSourcerer,代码行数:17,代码来源:ScrEff.cpp

示例9: stop

/*---------------------------------------------------------------------*//**
	動作停止
**//*---------------------------------------------------------------------*/
void Msg::stop(ActMatter* owner)
{
    EventData* evdat = owner->getEventSystemRefer()->getEventData();
    ASSERT(evdat != 0L);

    // メッセージを終了する
    TalkMatter* matter = (TalkMatter*)evdat->getMatterFromEvid(_evid);
    ASSERT(matter != 0L);
    matter->terminate();
    // マターを削除する
//	evdat->removeMatter(_evid);

    Act::stop(owner);
}
开发者ID:Altoterras,项目名称:TheHeartOfSourcerer,代码行数:17,代码来源:Msg.cpp

示例10: ASSERT

/*---------------------------------------------------------------------*//**
	ユーザー操作
**//*---------------------------------------------------------------------*/
bool EventMovieFront::operationToEvent(EventOp eop)
{
	EventSys* evsys = Game::getGame()->getEventSys(); ASSERT(evsys != 0L);
	if((eop == EOP_PAUSE) || (eop == EOP_PLAY))
	{
		evsys->setEventPause(eop == EOP_PAUSE);
		return true;
	}

	bool is = false;

	// 現在駆動している全ての Act に送信する
	ActMatter* actm = 0L;
	EventData* evdat = evsys->getEventData(); ASSERT(evdat != 0L);
	for(s32 i = 0; i < evdat->getEventMatterNum(); i++)
	{
		EventMatter* matter = evdat->getEventMatter(i);
		if(matter->getMatterType() == EMTYPE_ACT)	// ActMatter 判定
		{
			if(((ActMatter*)matter)->isBegin())	// 実行中かどうか判定
			{
				actm = (ActMatter*)matter;

				switch(eop)
				{
				case EOP_SKIP:
					actm->skip();					// スキップを行う
					is = true;
					break;
				case EOP_ENDWAIT:
					if(actm->isWaitMovieMsg())			// ムービー台詞待ち中
					{
						actm->doneWaitMovieMsg();	// 台詞待ちを終了する
						is = true;
					}
					break;
				case EOP_CHECKSKIP:
					if(actm->checkValidSkip())
					{
						is = true;					// 一つでもスキップ可能なら可とする
					}
					break;
				}
			}
		}
	}

	return is;
}
开发者ID:Altoterras,项目名称:TheHeartOfSourcerer,代码行数:52,代码来源:EventMovieFront.cpp

示例11: EventDataPointer

//Process possible events
bool CollectableAgent::HandleEvent(const EventData& data)
{
	bool eventprocessed = false;
	
	//Collectable receives event of being collected
	//IF - "Drop Collected event"
	if(data.GetEventType() == Event_DropCollision)
	{
		//Check if this was collected
		const DropCollidedEvent& theevent = static_cast<const DropCollidedEvent&>(data);
		//IF - Pointers match
		if(theevent.GetCollectedAgent() == this && !mCollected)
		{
			//Drop collected!
			//Destroy body
			mPhysicsManager->DestroyBody(mParams.physicbody);
			mCollected = true; //Memorize collected
			//Send event as drop was collected
			SingletonGameEventMgr::Instance()->QueueEvent(
												EventDataPointer(new EventData(Event_DropCollected))
											);
		}	
	}//IF
	
	return eventprocessed;
}
开发者ID:DarthMike,项目名称:Hydro,代码行数:27,代码来源:CollectableAgent.cpp

示例12: updateGaps

//during quali and free practice - gap for all laps is calculated to the best session time
void DriverData::updateGaps(const EventData &ed)
{
    for (int i = 0; i < lapData.size(); ++i)
        lapData[i].gap = QString::number((lapData[i].lapTime - ed.getSessionRecords().getFastestLap().getTime()).toDouble());


}
开发者ID:primijos,项目名称:f1lt,代码行数:8,代码来源:driverdata.cpp

示例13: HandleEvent

//Events plugin
bool StateMachine_MadMonkey::HandleEvent(const EventData& data)			
{
	bool eventprocessed(false);

	//IF - Exists state
	if(mCurrentState)
	{
		//Process overall state change

		//IF - A branch broke
		if(data.GetEventType() == Event_BranchBroke)
		{
			const BranchBrokeEvent& eventdata (static_cast<const BranchBrokeEvent&>(data));

			//IF - The target was this branch
			if(mTargetBodyChainId == eventdata.GetBodyChainId()
			   &&
			   mTargetAgentId == eventdata.GetAgentId())
			{
				//Reset state to search, as this branch is broken to hang
				mActor->ChangeState("Search");

				//Detach from Point 
				mActor->DetachFromPoint();
			}//IF 
		}
		
		//Forward event to current state
		return(eventprocessed || mCurrentState->HandleEvent(data));
	}

	//No state defined
	return eventprocessed;
}
开发者ID:DarthMike,项目名称:Monkey-Madness,代码行数:35,代码来源:StateMachine_MadMonkey.cpp

示例14: handleEvent

	bool MainMenuState::handleEvent( const EventData& theevent )
	{
		if(theevent.getEventType() == Event_NewGame)
		{
			Game::getInstance()->setNextStateType(State_Loading);
			m_endState = true;
		}

		if(theevent.getEventType() == Event_Credits)
		{
			Game::getInstance()->setNextStateType(State_Credits);
			m_endState = true;
		}

		return false;
	}
开发者ID:agiantwhale,项目名称:moon.chase.star,代码行数:16,代码来源:MainMenuState.cpp

示例15: Send

				EXPORT void Send(string type, EventData data)
				{
					EventData::iterator dIter;

					Sync::DataValue value;
					Sync::DataItem item;

					for (dIter = data.begin(); dIter != data.end(); dIter++)
					{
						value[dIter->first] = dIter->second;
					}

					item[type] = value;

					Sync::Client::Send(item);
				}
开发者ID:HeIIoween,项目名称:FLBoard,代码行数:16,代码来源:Event.cpp


注:本文中的EventData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。