MCPcopy Create free account
hub / github.com/bwapi/bwapi / RemoveDisconnected

Function RemoveDisconnected

bwapi/BWAPILIB/Source/Game.cpp:231–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229 }
230
231 void RemoveDisconnected(PlacementReserve &reserve, TilePosition desiredPosition)
232 {
233 TilePosition start = desiredPosition - TilePosition(MAX_RANGE,MAX_RANGE)/2;
234
235 // Assign 0 to all locations that aren't connected
236 reserve.iterate( [&](PlacementReserve *pr, int x, int y)
237 {
238 if ( !Broodwar->hasPath(Position(desiredPosition), Position(start + TilePosition(x,y)) ) )
239 pr->setValue(x, y, 0);
240 });
241 }
242
243 // @TODO: This interpretation might be incorrect
244 void ReserveStructureWithPadding(PlacementReserve &reserve, TilePosition currentPosition, TilePosition sizeExtra, int padding, UnitType type, TilePosition desiredPosition)

Callers 1

ReservePlacementFunction · 0.85

Calls 4

iterateMethod · 0.80
setValueMethod · 0.80
PositionClass · 0.50
hasPathMethod · 0.45

Tested by

no test coverage detected