Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
/* Copyright (C) 2021 Wildfire Games. | /* Copyright (C) 2022 Wildfire Games. | ||||||||||||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||||||||||||
* | * | ||||||||||||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||||||||||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||||||||||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||||||||||||
* (at your option) any later version. | * (at your option) any later version. | ||||||||||||||
* | * | ||||||||||||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||||||||||||
▲ Show 20 Lines • Show All 1,078 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