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

Method expand

game/state/battle/battleexplosion.cpp:182–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void BattleExplosion::expand(GameState &state, const TileMap &map, const Vec3<int> &from,
183 const Vec3<int> &to, int nextPower)
184{
185 // list of coordinates to check
186 static const std::map<Vec3<int>, std::list<std::pair<Vec3<int>, std::set<TileObject::Type>>>>
187 searchPattern = {
188 // Vertical
189 {{0, 0, 1}, {{{0, 0, 1}, {TileObject::Type::Ground, TileObject::Type::Feature}}}},
190 {{0, 0, -1},
191 {{{0, 0, 0}, {TileObject::Type::Ground}}, {{0, 0, -1}, {TileObject::Type::Feature}}}},
192 // Horizontal direct
193 {{0, -1, 0},
194 {{{0, 0, 0}, {TileObject::Type::RightWall}},
195 {{0, -1, 0}, {TileObject::Type::Feature}}}},
196 {{0, 1, 0},
197 {{{0, 1, 0}, {TileObject::Type::RightWall}},
198 {{0, 1, 0}, {TileObject::Type::Feature}}}},
199 {{-1, 0, 0},
200 {{{0, 0, 0}, {TileObject::Type::LeftWall}},
201 {{-1, 0, 0}, {TileObject::Type::Feature}}}},
202 {{1, 0, 0},
203 {{{1, 0, 0}, {TileObject::Type::LeftWall}}, {{1, 0, 0}, {TileObject::Type::Feature}}}},
204 // Horizontal top-left
205 {{-1, -1, 0},
206 {
207 {{-1, -1, 0}, {TileObject::Type::Feature}},
208 {{-1, 0, 0}, {TileObject::Type::Feature}},
209 {{0, -1, 0}, {TileObject::Type::Feature}},
210 {{-1, 0, 0}, {TileObject::Type::RightWall}},
211 {{0, -1, 0}, {TileObject::Type::LeftWall}},
212 {{0, 0, 0}, {TileObject::Type::RightWall}},
213 {{0, 0, 0}, {TileObject::Type::LeftWall}},
214 }},
215 // Horizontal bottom-right
216 {{1, 1, 0},
217 {
218 {{1, 1, 0}, {TileObject::Type::Feature}},
219 {{0, 1, 0}, {TileObject::Type::Feature}},
220 {{1, 0, 0}, {TileObject::Type::Feature}},
221 {{0, 1, 0}, {TileObject::Type::RightWall}},
222 {{1, 0, 0}, {TileObject::Type::LeftWall}},
223 {{1, 1, 0}, {TileObject::Type::RightWall}},
224 {{1, 1, 0}, {TileObject::Type::LeftWall}},
225 }},
226 // Horizontal top-right
227 {{1, -1, 0},
228 {
229 {{1, -1, 0}, {TileObject::Type::Feature}},
230 {{1, 0, 0}, {TileObject::Type::Feature}},
231 {{0, -1, 0}, {TileObject::Type::Feature}},
232 {{0, 0, 0}, {TileObject::Type::RightWall}},
233 {{1, -1, 0}, {TileObject::Type::LeftWall}},
234 {{1, 0, 0}, {TileObject::Type::RightWall}},
235 {{1, 0, 0}, {TileObject::Type::LeftWall}},
236 }},
237 // Horizontal bottom-left
238 {{-1, 1, 0},
239 {

Callers

nothing calls this directly

Calls 8

formatFunction · 0.85
endMethod · 0.80
insertMethod · 0.80
getTileMethod · 0.80
hasDamageDissipationMethod · 0.80
getTypeMethod · 0.45
getOwnerMethod · 0.45
placeDoodadMethod · 0.45

Tested by

no test coverage detected