MCPcopy Create free account
hub / github.com/chrxh/alien / addIfSpaceAvailable

Method addIfSpaceAvailable

source/EngineInterface/DescriptionEditService.cpp:339–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void DescriptionEditService::addIfSpaceAvailable(
340 DataDescription& result,
341 Occupancy& cellOccupancy,
342 DataDescription const& toAdd,
343 float distance,
344 IntVector2D const& worldSize)
345{
346 SpaceCalculator space(worldSize);
347
348 for (auto const& cell : toAdd.cells) {
349 if (!isCellPresent(cellOccupancy, space, cell.pos, distance)) {
350 result.addCell(cell);
351 cellOccupancy[toIntVector2D(cell.pos)].emplace_back(cell.pos);
352 }
353 }
354}
355
356void DescriptionEditService::reconnectCells(DataDescription& data, float maxDistance)
357{

Callers 1

onDrawingMethod · 0.80

Calls 2

toIntVector2DFunction · 0.85
addCellMethod · 0.80

Tested by

no test coverage detected