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

Function ReserveStructureWithPadding

bwapi/BWAPILIB/Source/Game.cpp:244–253  ·  view source on GitHub ↗

@TODO: This interpretation might be incorrect

Source from the content-addressed store, hash-verified

242
243 // @TODO: This interpretation might be incorrect
244 void ReserveStructureWithPadding(PlacementReserve &reserve, TilePosition currentPosition, TilePosition sizeExtra, int padding, UnitType type, TilePosition desiredPosition)
245 {
246 TilePosition paddingSize = sizeExtra + TilePosition(padding,padding)*2;
247
248 TilePosition topLeft = currentPosition - type.tileSize() - paddingSize/2 - TilePosition(1,1);
249 TilePosition topLeftRelative = topLeft - desiredPosition + TilePosition(MAX_RANGE,MAX_RANGE)/2;
250 TilePosition maxSize = topLeftRelative + type.tileSize() + paddingSize + TilePosition(1,1);
251
252 reserve.setRange(topLeftRelative, maxSize, 0);
253 }
254
255 /*
256 void ReserveUnbuildable(PlacementReserve &reserve, UnitType type, TilePosition desiredPosition)

Callers 1

ReserveStructureFunction · 0.85

Calls 2

tileSizeMethod · 0.80
setRangeMethod · 0.80

Tested by

no test coverage detected