MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getFacility

Method getFacility

game/state/city/base.cpp:148–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148sp<Facility> Base::getFacility(Vec2<int> pos) const
149{
150 for (auto &facility : facilities)
151 {
152 if (pos.x >= facility->pos.x && pos.x < facility->pos.x + facility->type->size &&
153 pos.y >= facility->pos.y && pos.y < facility->pos.y + facility->type->size)
154 {
155 return facility;
156 }
157 }
158 return nullptr;
159}
160
161static bool randomlyPlaceFacility(GameState &state, Base &base, StateRef<FacilityType> facility)
162{

Callers 1

eventOccurredMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected