Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
Show First 20 Lines • Show All 1,087 Lines • ▼ Show 20 Lines | |||||||||||||||
}; | }; | ||||||||||||||
END_COMMAND(DeleteObjects) | END_COMMAND(DeleteObjects) | ||||||||||||||
QUERYHANDLER(GetPlayerObjects) | QUERYHANDLER(GetPlayerObjects) | ||||||||||||||
{ | { | ||||||||||||||
std::vector<entity_id_t> ids; | std::vector<entity_id_t> ids; | ||||||||||||||
player_id_t playerID = msg->player; | player_id_t playerID = msg->player; | ||||||||||||||
const CSimulation2::InterfaceListUnordered& cmps = g_Game->GetSimulation2()->GetEntitiesWithInterfaceUnordered(IID_Ownership); | SComponentDataGenerator* cmps = g_Game->GetSimulation2()->GetEntitiesWithInterfaceUnordered(IID_Ownership); | ||||||||||||||
for (CSimulation2::InterfaceListUnordered::const_iterator eit = cmps.begin(); eit != cmps.end(); ++eit) | while(IComponent* cmp = cmps->Next()) | ||||||||||||||
Stan: indent | |||||||||||||||
{ | { | ||||||||||||||
if (static_cast<ICmpOwnership*>(eit->second)->GetOwner() == playerID) | if (static_cast<ICmpOwnership*>(cmp)->GetOwner() == playerID) | ||||||||||||||
{ | { | ||||||||||||||
ids.push_back(eit->first); | ids.push_back(cmp->GetEntityId()); | ||||||||||||||
} | } | ||||||||||||||
} | } | ||||||||||||||
Done Inline Actions
Stan: | |||||||||||||||
msg->ids = ids; | msg->ids = ids; | ||||||||||||||
Done Inline ActionsUnrelated, but worth considering std::move()ing the RHS to avoid a copy jprahman: Unrelated, but worth considering `std::move()`ing the RHS to avoid a copy | |||||||||||||||
} | } | ||||||||||||||
MESSAGEHANDLER(SetBandbox) | MESSAGEHANDLER(SetBandbox) | ||||||||||||||
{ | { | ||||||||||||||
AtlasView::GetView_Game()->SetBandbox(msg->show, (float)msg->sx0, (float)msg->sy0, (float)msg->sx1, (float)msg->sy1); | AtlasView::GetView_Game()->SetBandbox(msg->show, (float)msg->sx0, (float)msg->sy0, (float)msg->sx1, (float)msg->sy1); | ||||||||||||||
} | } | ||||||||||||||
QUERYHANDLER(GetSelectedObjectsTemplateNames) | QUERYHANDLER(GetSelectedObjectsTemplateNames) | ||||||||||||||
Show All 19 Lines |
Wildfire Games · Phabricator
indent