Game Development Reference
In-Depth Information
shared_ptr<IGameView> pView = *it;
if (pView->VGetType() == GameView_Human)
{
StrongActorPtr pActor =
VCreateActor(
actors\\player_teapot.xml
, NULL);
if (pActor)
{
shared_ptr<EvtData_New_Actor> pNewActorEvent(
GCC_NEW EvtData_New_Actor(
pActor->GetId(), pView->VGetId()));
IEventManager::Get()->VTriggerEvent(pNewActorEvent);
}
}
else if (pView->VGetType() == GameView_Remote)
{
shared_ptr<NetworkGameView> pNetworkGameView =
static_pointer_cast<NetworkGameView, IGameView>(pView);
StrongActorPtr pActor =
VCreateActor(“actors\\remote_teapot.xml”, NULL);
if (pActor)
{
shared_ptr<EvtData_New_Actor> pNewActorEvent(
GCC_NEW EvtData_New_Actor(pActor->GetId(),
pNetworkGameView->VGetId()));
IEventManager::Get()->VQueueEvent(pNewActorEvent);
}
}
else if (pView->VGetType() == GameView_AI)
{
shared_ptr<AITeapotView> pAiView =
static_pointer_cast<AITeapotView, IGameView>(pView);
StrongActorPtr pActor =
VCreateActor(
actors\\ai_teapot.xml
, NULL);
if (pActor)
{
shared_ptr<EvtData_New_Actor> pNewActorEvent(
GCC_NEW EvtData_New_Actor(
pActor->GetId(), pAiView->VGetId()));
IEventManager::Get()->VQueueEvent(pNewActorEvent);
}
}
}
break;
Search WWH ::




Custom Search