From 43513c31527d3708273d286b67c0745931fcd59b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:59:57 +0000 Subject: [PATCH 1/3] Initial plan From e2ee4a335f41a42a84e1c817525f836da2891dad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:08:40 +0100 Subject: [PATCH 2/3] Rename Structure object type to Solid across codebase Renames all occurrences of the "Structure" object type to "Solid": - ObjectType_Structure -> ObjectType_Solid - Structure (struct) -> Solid, StructureTO -> SolidTO, StructureDesc -> SolidDesc - DetectStructure* -> DetectSolid*, ReconnectStructure* -> ReconnectSolid* - SensorMode_DetectStructure -> SensorMode_DetectSolid - ReconnectorMode_Structure -> ReconnectorMode_Solid - ObjectTypeData::structure -> ObjectTypeData::solid - getStructureRef() -> getSolidRef() - All related variables, members, labels and comments updated Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com> Agent-Logs-Url: https://github.com/chrxh/alien/sessions/4f2049e2-f303-4cc4-a747-5b394e3b0b58 --- source/EngineGpuKernels/AttackerProcessor.cuh | 2 +- source/EngineGpuKernels/CellProcessor.cuh | 2 +- source/EngineGpuKernels/ClusterProcessor.cuh | 80 +++++++++---------- source/EngineGpuKernels/DataAccessKernels.cu | 12 +-- source/EngineGpuKernels/EnergyProcessor.cuh | 2 +- source/EngineGpuKernels/Entities.cuh | 18 ++--- source/EngineGpuKernels/EntityFactory.cuh | 16 ++-- source/EngineGpuKernels/Genome.cuh | 8 +- source/EngineGpuKernels/GenomeTO.cuh | 8 +- source/EngineGpuKernels/GeometryKernels.cu | 4 +- source/EngineGpuKernels/ObjectProcessor.cuh | 4 +- .../EngineGpuKernels/ReconnectorProcessor.cuh | 6 +- source/EngineGpuKernels/SensorProcessor.cuh | 10 +-- source/EngineGpuKernels/TOs.cuh | 14 ++-- source/EngineImpl/DescConverterService.cpp | 50 ++++++------ source/EngineInterface/CellTypeConstants.h | 12 +-- source/EngineInterface/CellTypeStrings.h | 2 +- source/EngineInterface/Desc.cpp | 20 ++--- source/EngineInterface/Desc.h | 24 +++--- source/EngineInterface/DescEditService.cpp | 4 +- source/EngineInterface/DescEditService.h | 6 +- source/EngineInterface/GenomeDesc.cpp | 8 +- source/EngineInterface/GenomeDesc.h | 12 +-- source/EngineInterface/GenomeDescHash.h | 8 +- source/EngineInterface/GeometryBuffers.h | 2 +- .../DescEditServiceTests.cpp | 34 ++++---- source/EngineTestData/DescTestDataFactory.cpp | 38 ++++----- .../EngineTests/CellStateTransitionTests.cpp | 6 +- source/EngineTests/DataTransferTests.cpp | 4 +- source/EngineTests/EditTests.cpp | 4 +- .../EngineTests/IntegrationTestFramework.cpp | 4 +- source/EngineTests/ObjectConnectionTests.cpp | 26 +++--- source/EngineTests/RadiationTests.cpp | 8 +- source/EngineTests/ReconnectorTests.cpp | 72 ++++++++--------- source/EngineTests/SensorTests.cpp | 52 ++++++------ source/Gui/CreatorWindow.cpp | 8 +- source/Gui/CreatorWindow.h | 2 +- source/Gui/HelpStrings.h | 4 +- source/Gui/ImageToPatternDialog.cpp | 2 +- source/Gui/InspectorWindow.cpp | 6 +- source/Gui/MassOperationsDialog.cpp | 2 +- source/Gui/NodeEditorWidget.cpp | 14 ++-- source/Gui/RenderStep.cpp | 8 +- .../PersisterInterface/SerializerService.cpp | 26 +++--- source/Shaders/CellTypeOverlayGS.h | 6 +- 45 files changed, 330 insertions(+), 330 deletions(-) diff --git a/source/EngineGpuKernels/AttackerProcessor.cuh b/source/EngineGpuKernels/AttackerProcessor.cuh index 772ea288f7..d506f560fc 100644 --- a/source/EngineGpuKernels/AttackerProcessor.cuh +++ b/source/EngineGpuKernels/AttackerProcessor.cuh @@ -111,7 +111,7 @@ __device__ __inline__ void AttackerProcessor::processCell(SimulationData& data, auto sumEnergyToTransfer = 0.0f; data.objectMap.executeForEach( object->pos, cudaSimulationParameters.attackerRadius.value[object->color], object->detached, [&](auto const& otherObject) { - if (otherObject->type == ObjectType_Structure || otherObject->type == ObjectType_Fluid) { + if (otherObject->type == ObjectType_Solid || otherObject->type == ObjectType_Fluid) { return; } if (otherObject->fixed) { diff --git a/source/EngineGpuKernels/CellProcessor.cuh b/source/EngineGpuKernels/CellProcessor.cuh index 6fb6257bbc..99efe7c426 100644 --- a/source/EngineGpuKernels/CellProcessor.cuh +++ b/source/EngineGpuKernels/CellProcessor.cuh @@ -66,7 +66,7 @@ __inline__ __device__ void CellProcessor::aging(SimulationData& data) auto const partition = calcSystemThreadPartition(data.entities.objects.getNumEntries()); for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto& object = data.entities.objects.at(index); - if (object->fixed || object->type == ObjectType_Structure || object->type == ObjectType_Fluid) { + if (object->fixed || object->type == ObjectType_Solid || object->type == ObjectType_Fluid) { continue; } uint32_t* age = nullptr; diff --git a/source/EngineGpuKernels/ClusterProcessor.cuh b/source/EngineGpuKernels/ClusterProcessor.cuh index 4ee3187f4c..521e08723f 100644 --- a/source/EngineGpuKernels/ClusterProcessor.cuh +++ b/source/EngineGpuKernels/ClusterProcessor.cuh @@ -29,16 +29,16 @@ __device__ __inline__ void ClusterProcessor::initClusterData(SimulationData& dat for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto& object = objects.at(index); - if (object->type != ObjectType_Structure) { + if (object->type != ObjectType_Solid) { continue; } - object->typeData.structure.clusterIndex = index; - object->typeData.structure.clusterBoundaries = 0; - object->typeData.structure.clusterPos = {0, 0}; - object->typeData.structure.clusterVel = {0, 0}; - object->typeData.structure.clusterAngularMass = 0; - object->typeData.structure.clusterAngularMomentum = 0; - object->typeData.structure.numCellsInCluster = 0; + object->typeData.solid.clusterIndex = index; + object->typeData.solid.clusterBoundaries = 0; + object->typeData.solid.clusterPos = {0, 0}; + object->typeData.solid.clusterVel = {0, 0}; + object->typeData.solid.clusterAngularMass = 0; + object->typeData.solid.clusterAngularMomentum = 0; + object->typeData.solid.numCellsInCluster = 0; } } @@ -49,7 +49,7 @@ __device__ __inline__ void ClusterProcessor::findClusterIteration(SimulationData for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto currentObject = objects.at(index); - if (currentObject->type != ObjectType_Structure) { + if (currentObject->type != ObjectType_Solid) { continue; } @@ -58,11 +58,11 @@ __device__ __inline__ void ClusterProcessor::findClusterIteration(SimulationData bool found = false; for (int j = 0; j < currentObject->numConnections; ++j) { auto candidateObject = currentObject->connections[j].object; - if (candidateObject->type != ObjectType_Structure) { + if (candidateObject->type != ObjectType_Solid) { continue; } - auto cellTag = currentObject->typeData.structure.clusterIndex; - auto origTag = atomicMin(&candidateObject->typeData.structure.clusterIndex, cellTag); + auto cellTag = currentObject->typeData.solid.clusterIndex; + auto origTag = atomicMin(&candidateObject->typeData.solid.clusterIndex, cellTag); if (cellTag < origTag) { currentObject = candidateObject; found = true; @@ -83,15 +83,15 @@ __device__ __inline__ void ClusterProcessor::findClusterBoundaries(SimulationDat for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto object = objects.at(index); - if (object->type != ObjectType_Structure) { + if (object->type != ObjectType_Solid) { continue; } - auto cluster = objects.at(object->typeData.structure.clusterIndex); + auto cluster = objects.at(object->typeData.solid.clusterIndex); if (object->pos.x < data.worldSize.x / 3) { - atomicOr(&cluster->typeData.structure.clusterBoundaries, 1); + atomicOr(&cluster->typeData.solid.clusterBoundaries, 1); } if (object->pos.y < data.worldSize.y / 3) { - atomicOr(&cluster->typeData.structure.clusterBoundaries, 2); + atomicOr(&cluster->typeData.solid.clusterBoundaries, 2); } } } @@ -103,26 +103,26 @@ __device__ __inline__ void ClusterProcessor::accumulateClusterPosAndVel(Simulati for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto object = objects.at(index); - if (object->type != ObjectType_Structure) { + if (object->type != ObjectType_Solid) { continue; } - auto cluster = objects.at(object->typeData.structure.clusterIndex); - atomicAdd(&cluster->typeData.structure.clusterVel.x, object->vel.x); - atomicAdd(&cluster->typeData.structure.clusterVel.y, object->vel.y); + auto cluster = objects.at(object->typeData.solid.clusterIndex); + atomicAdd(&cluster->typeData.solid.clusterVel.x, object->vel.x); + atomicAdd(&cluster->typeData.solid.clusterVel.y, object->vel.y); //topology correction auto cellPos = object->pos; - if ((cluster->typeData.structure.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { cellPos.x -= data.worldSize.x; } - if ((cluster->typeData.structure.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { cellPos.y -= data.worldSize.y; } - atomicAdd(&cluster->typeData.structure.clusterPos.x, cellPos.x); - atomicAdd(&cluster->typeData.structure.clusterPos.y, cellPos.y); + atomicAdd(&cluster->typeData.solid.clusterPos.x, cellPos.x); + atomicAdd(&cluster->typeData.solid.clusterPos.y, cellPos.y); - atomicAdd(&cluster->typeData.structure.numCellsInCluster, 1); + atomicAdd(&cluster->typeData.solid.numCellsInCluster, 1); } } @@ -133,27 +133,27 @@ __device__ __inline__ void ClusterProcessor::accumulateClusterAngularProp(Simula for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto object = objects.at(index); - if (object->type != ObjectType_Structure) { + if (object->type != ObjectType_Solid) { continue; } - auto cluster = objects.at(object->typeData.structure.clusterIndex); - auto clusterVel = cluster->typeData.structure.clusterVel / cluster->typeData.structure.numCellsInCluster; - auto clusterPos = cluster->typeData.structure.clusterPos / cluster->typeData.structure.numCellsInCluster; + auto cluster = objects.at(object->typeData.solid.clusterIndex); + auto clusterVel = cluster->typeData.solid.clusterVel / cluster->typeData.solid.numCellsInCluster; + auto clusterPos = cluster->typeData.solid.clusterPos / cluster->typeData.solid.numCellsInCluster; //topology correction auto cellPos = object->pos; - if ((cluster->typeData.structure.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { cellPos.x -= data.worldSize.x; } - if ((cluster->typeData.structure.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { cellPos.y -= data.worldSize.y; } auto r = cellPos - clusterPos; auto angularMass = Math::lengthSquared(r); auto angularMomentum = Physics::angularMomentum(r, object->vel - clusterVel); - atomicAdd(&cluster->typeData.structure.clusterAngularMass, angularMass); - atomicAdd(&cluster->typeData.structure.clusterAngularMomentum, angularMomentum); + atomicAdd(&cluster->typeData.solid.clusterAngularMass, angularMass); + atomicAdd(&cluster->typeData.solid.clusterAngularMomentum, angularMomentum); } } @@ -164,23 +164,23 @@ __device__ __inline__ void ClusterProcessor::applyClusterData(SimulationData& da for (int index = partition.startIndex; index <= partition.endIndex; index += partition.step) { auto object = objects.at(index); - if (object->type != ObjectType_Structure) { + if (object->type != ObjectType_Solid) { continue; } - auto cluster = objects.at(object->typeData.structure.clusterIndex); - auto clusterPos = cluster->typeData.structure.clusterPos / cluster->typeData.structure.numCellsInCluster; - auto clusterVel = cluster->typeData.structure.clusterVel / cluster->typeData.structure.numCellsInCluster; + auto cluster = objects.at(object->typeData.solid.clusterIndex); + auto clusterPos = cluster->typeData.solid.clusterPos / cluster->typeData.solid.numCellsInCluster; + auto clusterVel = cluster->typeData.solid.clusterVel / cluster->typeData.solid.numCellsInCluster; auto cellPos = object->pos; - if ((cluster->typeData.structure.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 1) == 1 && cellPos.x > data.worldSize.x * 2 / 3) { cellPos.x -= data.worldSize.x; } - if ((cluster->typeData.structure.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { + if ((cluster->typeData.solid.clusterBoundaries & 2) == 2 && cellPos.y > data.worldSize.y * 2 / 3) { cellPos.y -= data.worldSize.y; } auto r = cellPos - clusterPos; - auto angularVel = Physics::angularVelocity(cluster->typeData.structure.clusterAngularMomentum, cluster->typeData.structure.clusterAngularMass); + auto angularVel = Physics::angularVelocity(cluster->typeData.solid.clusterAngularMomentum, cluster->typeData.solid.clusterAngularMass); auto rigidity = ParameterCalculator::calcParameter(cudaSimulationParameters.rigidity, data, object->pos) * object->stiffness * object->stiffness; object->vel = object->vel * (1.0f - rigidity) + Physics::tangentialVelocity(r, clusterVel, angularVel) * rigidity; diff --git a/source/EngineGpuKernels/DataAccessKernels.cu b/source/EngineGpuKernels/DataAccessKernels.cu index f970cc13ff..514aae1291 100644 --- a/source/EngineGpuKernels/DataAccessKernels.cu +++ b/source/EngineGpuKernels/DataAccessKernels.cu @@ -102,7 +102,7 @@ namespace if (nodeTO.cellTypeData.sensor.mode == SensorMode_Telemetry) { } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectEnergy) { nodeTO.cellTypeData.sensor.modeData.detectEnergy.minDensity = node.cellTypeData.sensor.modeData.detectEnergy.minDensity; - } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectStructure) { + } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectSolid) { } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { nodeTO.cellTypeData.sensor.modeData.detectFreeCell.minDensity = node.cellTypeData.sensor.modeData.detectFreeCell.minDensity; nodeTO.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors = @@ -177,7 +177,7 @@ namespace break; case CellType_Reconnector: nodeTO.cellTypeData.reconnector.mode = node.cellTypeData.reconnector.mode; - if (node.cellTypeData.reconnector.mode == ReconnectorMode_Structure) { + if (node.cellTypeData.reconnector.mode == ReconnectorMode_Solid) { } else if (node.cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { nodeTO.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors = node.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors; @@ -312,8 +312,8 @@ namespace object->tempValue1.as_uint64 = objectTOIndex; - if (object->type == ObjectType_Structure) { - objectTO.typeData.structure.energy = object->typeData.structure.energy; + if (object->type == ObjectType_Solid) { + objectTO.typeData.solid.energy = object->typeData.solid.energy; } else if (object->type == ObjectType_Fluid) { objectTO.typeData.fluid.energy = object->typeData.fluid.energy; objectTO.typeData.fluid.glow = object->typeData.fluid.glow; @@ -384,7 +384,7 @@ namespace if (cellTO.cellTypeData.sensor.mode == SensorMode_Telemetry) { } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectEnergy) { cellTO.cellTypeData.sensor.modeData.detectEnergy.minDensity = cell.cellTypeData.sensor.modeData.detectEnergy.minDensity; - } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectStructure) { + } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectSolid) { } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { cellTO.cellTypeData.sensor.modeData.detectFreeCell.minDensity = cell.cellTypeData.sensor.modeData.detectFreeCell.minDensity; cellTO.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors = cell.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors; @@ -463,7 +463,7 @@ namespace } break; case CellType_Reconnector: { cellTO.cellTypeData.reconnector.mode = cell.cellTypeData.reconnector.mode; - if (cell.cellTypeData.reconnector.mode == ReconnectorMode_Structure) { + if (cell.cellTypeData.reconnector.mode == ReconnectorMode_Solid) { } else if (cell.cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { cellTO.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors = cell.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors; diff --git a/source/EngineGpuKernels/EnergyProcessor.cuh b/source/EngineGpuKernels/EnergyProcessor.cuh index cceccb49a4..b8b0cf362f 100644 --- a/source/EngineGpuKernels/EnergyProcessor.cuh +++ b/source/EngineGpuKernels/EnergyProcessor.cuh @@ -103,7 +103,7 @@ __inline__ __device__ void EnergyProcessor::collision(SimulationData& data) } } else { if (auto object = data.objectMap.getFirst(particle->pos + particle->vel)) { - if (object->type == ObjectType_Structure || object->type == ObjectType_Fluid) { + if (object->type == ObjectType_Solid || object->type == ObjectType_Fluid) { continue; } if (object->fixed) { diff --git a/source/EngineGpuKernels/Entities.cuh b/source/EngineGpuKernels/Entities.cuh index 1959f8cb55..9d23eb76bb 100644 --- a/source/EngineGpuKernels/Entities.cuh +++ b/source/EngineGpuKernels/Entities.cuh @@ -101,7 +101,7 @@ struct DetectEnergy float minDensity; }; -struct DetectStructure +struct DetectSolid {}; struct DetectFreeCell @@ -122,7 +122,7 @@ union SensorModeData { Telemetry telemetry; DetectEnergy detectEnergy; - DetectStructure detectStructure; + DetectSolid detectSolid; DetectFreeCell detectFreeCell; DetectCreature detectCreature; }; @@ -292,7 +292,7 @@ struct Defender DefenderMode mode; }; -struct ReconnectStructure +struct ReconnectSolid {}; struct ReconnectFreeCell @@ -310,7 +310,7 @@ struct ReconnectCreature union ReconnectorModeData { - ReconnectStructure reconnectStructure; + ReconnectSolid reconnectSolid; ReconnectFreeCell reconnectFreeCell; ReconnectCreature reconnectCreature; }; @@ -458,7 +458,7 @@ struct Creature uint64_t creatureIndex; // May be invalid }; -struct Structure +struct Solid { float energy; @@ -506,7 +506,7 @@ struct Cell uint16_t geneIndex; // Cell type data - NeuralNet* neuralNetwork; // Not used for structure and base cells + NeuralNet* neuralNetwork; // Not used for solid and base cells CellType cellType; CellTypeData cellTypeData; bool constructorAvailable; // If true, constructor holds valid data @@ -541,7 +541,7 @@ struct Cell union ObjectTypeData { - Structure structure; + Solid solid; Fluid fluid; FreeCell freeCell; Cell cell; @@ -614,8 +614,8 @@ struct Object return typeData.cell.getEnergy(); } else if (type == ObjectType_FreeCell) { return typeData.freeCell.energy; - } else if (type == ObjectType_Structure) { - return typeData.structure.energy; + } else if (type == ObjectType_Solid) { + return typeData.solid.energy; } else if (type == ObjectType_Fluid) { return typeData.fluid.energy; } else { diff --git a/source/EngineGpuKernels/EntityFactory.cuh b/source/EngineGpuKernels/EntityFactory.cuh index 10df3343e4..af8eccd107 100644 --- a/source/EngineGpuKernels/EntityFactory.cuh +++ b/source/EngineGpuKernels/EntityFactory.cuh @@ -164,7 +164,7 @@ __inline__ __device__ Genome* EntityFactory::createGenomeFromTO(TOs const& to, i if (nodeTO.cellTypeData.sensor.mode == SensorMode_Telemetry) { } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectEnergy) { node.cellTypeData.sensor.modeData.detectEnergy.minDensity = nodeTO.cellTypeData.sensor.modeData.detectEnergy.minDensity; - } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectStructure) { + } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectSolid) { } else if (nodeTO.cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { node.cellTypeData.sensor.modeData.detectFreeCell.minDensity = nodeTO.cellTypeData.sensor.modeData.detectFreeCell.minDensity; node.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors = nodeTO.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors; @@ -233,7 +233,7 @@ __inline__ __device__ Genome* EntityFactory::createGenomeFromTO(TOs const& to, i break; case CellType_Reconnector: node.cellTypeData.reconnector.mode = nodeTO.cellTypeData.reconnector.mode; - if (nodeTO.cellTypeData.reconnector.mode == ReconnectorMode_Structure) { + if (nodeTO.cellTypeData.reconnector.mode == ReconnectorMode_Solid) { } else if (nodeTO.cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { node.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors = nodeTO.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors; @@ -366,8 +366,8 @@ __inline__ __device__ void EntityFactory::changeObjectFromTO(TOs const& to, Obje object->sticky = objectTO.sticky; object->type = objectTO.type; - if (objectTO.type == ObjectType_Structure) { - object->typeData.structure.energy = objectTO.typeData.structure.energy; + if (objectTO.type == ObjectType_Solid) { + object->typeData.solid.energy = objectTO.typeData.solid.energy; } else if (objectTO.type == ObjectType_Fluid) { object->typeData.fluid.energy = objectTO.typeData.fluid.energy; object->typeData.fluid.glow = objectTO.typeData.fluid.glow; @@ -439,7 +439,7 @@ __inline__ __device__ void EntityFactory::changeObjectFromTO(TOs const& to, Obje if (cellTO.cellTypeData.sensor.mode == SensorMode_Telemetry) { } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectEnergy) { cell->cellTypeData.sensor.modeData.detectEnergy.minDensity = cellTO.cellTypeData.sensor.modeData.detectEnergy.minDensity; - } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectStructure) { + } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectSolid) { } else if (cellTO.cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { cell->cellTypeData.sensor.modeData.detectFreeCell.minDensity = cellTO.cellTypeData.sensor.modeData.detectFreeCell.minDensity; cell->cellTypeData.sensor.modeData.detectFreeCell.restrictToColors = cellTO.cellTypeData.sensor.modeData.detectFreeCell.restrictToColors; @@ -517,7 +517,7 @@ __inline__ __device__ void EntityFactory::changeObjectFromTO(TOs const& to, Obje } break; case CellType_Reconnector: { cell->cellTypeData.reconnector.mode = cellTO.cellTypeData.reconnector.mode; - if (cellTO.cellTypeData.reconnector.mode == ReconnectorMode_Structure) { + if (cellTO.cellTypeData.reconnector.mode == ReconnectorMode_Solid) { } else if (cellTO.cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { cell->cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors = cellTO.cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors; @@ -788,7 +788,7 @@ __inline__ __device__ Object* EntityFactory::createCellFromNode( if (nodeSensor.mode == SensorMode_Telemetry) { } else if (nodeSensor.mode == SensorMode_DetectEnergy) { sensor.modeData.detectEnergy.minDensity = nodeSensor.modeData.detectEnergy.minDensity; - } else if (nodeSensor.mode == SensorMode_DetectStructure) { + } else if (nodeSensor.mode == SensorMode_DetectSolid) { } else if (nodeSensor.mode == SensorMode_DetectFreeCell) { sensor.modeData.detectFreeCell.minDensity = nodeSensor.modeData.detectFreeCell.minDensity; sensor.modeData.detectFreeCell.restrictToColors = nodeSensor.modeData.detectFreeCell.restrictToColors; @@ -886,7 +886,7 @@ __inline__ __device__ Object* EntityFactory::createCellFromNode( auto const& nodeReconnector = node->cellTypeData.reconnector; auto& reconnector = cell.cellTypeData.reconnector; reconnector.mode = nodeReconnector.mode; - if (nodeReconnector.mode == ReconnectorMode_Structure) { + if (nodeReconnector.mode == ReconnectorMode_Solid) { } else if (nodeReconnector.mode == ReconnectorMode_FreeCell) { reconnector.modeData.reconnectFreeCell.restrictToColors = nodeReconnector.modeData.reconnectFreeCell.restrictToColors; } else if (nodeReconnector.mode == ReconnectorMode_Creature) { diff --git a/source/EngineGpuKernels/Genome.cuh b/source/EngineGpuKernels/Genome.cuh index 94d10962cb..1f946bde7c 100644 --- a/source/EngineGpuKernels/Genome.cuh +++ b/source/EngineGpuKernels/Genome.cuh @@ -37,7 +37,7 @@ struct DetectEnergyGenome float minDensity; }; -struct DetectStructureGenome +struct DetectSolidGenome {}; struct DetectFreeCellGenome @@ -58,7 +58,7 @@ union SensorModeGenome { TelemetryGenome telemetry; DetectEnergyGenome detectEnergy; - DetectStructureGenome detectStructure; + DetectSolidGenome detectSolid; DetectFreeCellGenome detectFreeCell; DetectCreatureGenome detectCreature; }; @@ -188,7 +188,7 @@ struct DefenderGenome DefenderMode mode; }; -struct ReconnectStructureGenome +struct ReconnectSolidGenome {}; struct ReconnectFreeCellGenome @@ -206,7 +206,7 @@ struct ReconnectCreatureGenome union ReconnectorModeGenome { - ReconnectStructureGenome reconnectStructure; + ReconnectSolidGenome reconnectSolid; ReconnectFreeCellGenome reconnectFreeCell; ReconnectCreatureGenome reconnectCreature; }; diff --git a/source/EngineGpuKernels/GenomeTO.cuh b/source/EngineGpuKernels/GenomeTO.cuh index 36b79f733e..ec860a205b 100644 --- a/source/EngineGpuKernels/GenomeTO.cuh +++ b/source/EngineGpuKernels/GenomeTO.cuh @@ -37,7 +37,7 @@ struct DetectEnergyGenomeTO float minDensity; }; -struct DetectStructureGenomeTO +struct DetectSolidGenomeTO {}; struct DetectFreeCellGenomeTO @@ -58,7 +58,7 @@ union SensorModeGenomeTO { TelemetryGenomeTO telemetry; DetectEnergyGenomeTO detectEnergy; - DetectStructureGenomeTO detectStructure; + DetectSolidGenomeTO detectSolid; DetectFreeCellGenomeTO detectFreeCell; DetectCreatureGenomeTO detectCreature; }; @@ -193,7 +193,7 @@ struct DefenderGenomeTO DefenderMode mode; }; -struct ReconnectStructureGenomeTO +struct ReconnectSolidGenomeTO {}; struct ReconnectFreeCellGenomeTO @@ -211,7 +211,7 @@ struct ReconnectCreatureGenomeTO union ReconnectorModeGenomeTO { - ReconnectStructureGenomeTO reconnectStructure; + ReconnectSolidGenomeTO reconnectSolid; ReconnectFreeCellGenomeTO reconnectFreeCell; ReconnectCreatureGenomeTO reconnectCreature; }; diff --git a/source/EngineGpuKernels/GeometryKernels.cu b/source/EngineGpuKernels/GeometryKernels.cu index c5d56bef4f..426c9fcba9 100644 --- a/source/EngineGpuKernels/GeometryKernels.cu +++ b/source/EngineGpuKernels/GeometryKernels.cu @@ -181,8 +181,8 @@ __global__ void cudaExtractObjectData(SimulationData data, ObjectVertexData* obj } else if (object->type == ObjectType_Fluid) { luminance = object->typeData.fluid.energy / 300.0f; } else { - // Structure - use energy for luminance if available - luminance = object->typeData.structure.energy / 300.0f; + // Solid - use energy for luminance if available + luminance = object->typeData.solid.energy / 300.0f; } auto white = luminance / 10.0f; diff --git a/source/EngineGpuKernels/ObjectProcessor.cuh b/source/EngineGpuKernels/ObjectProcessor.cuh index 9048326650..a905b3d611 100644 --- a/source/EngineGpuKernels/ObjectProcessor.cuh +++ b/source/EngineGpuKernels/ObjectProcessor.cuh @@ -85,7 +85,7 @@ __inline__ __device__ void ObjectProcessor::fillDensityMap(SimulationData& data) auto object = data.entities.objects.at(index); if (object->type == ObjectType_FreeCell) { data.preprocessedSimulationData.densityMap.addFreeCell(object); - } else if (object->type == ObjectType_Structure) { + } else if (object->type == ObjectType_Solid) { data.preprocessedSimulationData.densityMap.addStructureObject(object); } } @@ -646,7 +646,7 @@ __inline__ __device__ void ObjectProcessor::radiation(SimulationData& data) if (object->fixed) { continue; } - if (object->type == ObjectType_Structure || object->type == ObjectType_Fluid) { + if (object->type == ObjectType_Solid || object->type == ObjectType_Fluid) { continue; } if (data.primaryNumberGen.random() < cudaSimulationParameters.radiationProbability) { diff --git a/source/EngineGpuKernels/ReconnectorProcessor.cuh b/source/EngineGpuKernels/ReconnectorProcessor.cuh index 386737d621..463821acb5 100644 --- a/source/EngineGpuKernels/ReconnectorProcessor.cuh +++ b/source/EngineGpuKernels/ReconnectorProcessor.cuh @@ -60,9 +60,9 @@ __inline__ __device__ void ReconnectorProcessor::tryCreateConnection(SimulationD return; } - if (reconnectorMode == ReconnectorMode_Structure) { - // Connect to structure cells only - if (otherObject->type != ObjectType_Structure) { + if (reconnectorMode == ReconnectorMode_Solid) { + // Connect to solid cells only + if (otherObject->type != ObjectType_Solid) { return; } } else if (reconnectorMode == ReconnectorMode_FreeCell) { diff --git a/source/EngineGpuKernels/SensorProcessor.cuh b/source/EngineGpuKernels/SensorProcessor.cuh index 363a25c550..8d2954136f 100644 --- a/source/EngineGpuKernels/SensorProcessor.cuh +++ b/source/EngineGpuKernels/SensorProcessor.cuh @@ -206,7 +206,7 @@ __inline__ __device__ void SensorProcessor::initialScan(SimulationData& data, Si } } - // Block ray if it encounters structure cells + // Block ray if it encounters solid cells if (densityMap.getStructureDensity(scanPos) > 0) { break; } @@ -233,7 +233,7 @@ __inline__ __device__ void SensorProcessor::initialScan(SimulationData& data, Si data.objectMap.correctPosition(matchPos); // No relocation for structures - if (object->typeData.cell.cellTypeData.sensor.mode != SensorMode_DetectStructure) { + if (object->typeData.cell.cellTypeData.sensor.mode != SensorMode_DetectSolid) { object->typeData.cell.cellTypeData.sensor.lastMatchAvailable = true; object->typeData.cell.cellTypeData.sensor.lastMatch.creatureIdPart = creatureIdPart; object->typeData.cell.cellTypeData.sensor.lastMatch.pos = matchPos; @@ -291,7 +291,7 @@ __inline__ __device__ void SensorProcessor::relocateLastMatch(SimulationData& da } __syncthreads(); - // Check if ray from sensor to match pos is blocked by structure + // Check if ray from sensor to match pos is blocked by solid if (distance >= ScanStep) { auto const partition = calcSystemThreadPartition(toInt(distance) / ScanStep); auto const& densityMap = data.preprocessedSimulationData.densityMap; @@ -355,7 +355,7 @@ SensorProcessor::getMatchInfo(SimulationData& data, Object* object, float2 const if (density >= minDensity) { return pack(distance, absAngle, density); } - } else if (mode == SensorMode_DetectStructure) { + } else if (mode == SensorMode_DetectSolid) { if (densityMap.getStructureDensity(scanPos) > 0) { return pack(distance, absAngle, 1.0f); } @@ -376,7 +376,7 @@ SensorProcessor::getMatchInfo(SimulationData& data, Object* object, float2 const auto otherObject = data.objectMap.getFirst(scanPos); while (otherObject != nullptr) { - // Check if this cell is part of a creature (not structure or free object) + // Check if this cell is part of a creature (not solid or free object) if (otherObject->type == ObjectType_Cell && !cell->isSameCreature(&otherObject->typeData.cell)) { bool matches = true; diff --git a/source/EngineGpuKernels/TOs.cuh b/source/EngineGpuKernels/TOs.cuh index 4386e5c39d..ce422a5211 100644 --- a/source/EngineGpuKernels/TOs.cuh +++ b/source/EngineGpuKernels/TOs.cuh @@ -76,7 +76,7 @@ struct DetectEnergyTO float minDensity; }; -struct DetectStructureTO +struct DetectSolidTO {}; struct DetectFreeCellTO @@ -97,7 +97,7 @@ union SensorModeTO { TelemetryTO telemetry; DetectEnergyTO detectEnergy; - DetectStructureTO detectStructure; + DetectSolidTO detectSolid; DetectFreeCellTO detectFreeCell; DetectCreatureTO detectCreature; }; @@ -262,7 +262,7 @@ struct DefenderTO DefenderMode mode; }; -struct ReconnectStructureTO +struct ReconnectSolidTO {}; struct ReconnectFreeCellTO @@ -280,7 +280,7 @@ struct ReconnectCreatureTO union ReconnectorModeTO { - ReconnectStructureTO reconnectStructure; + ReconnectSolidTO reconnectSolid; ReconnectFreeCellTO reconnectFreeCell; ReconnectCreatureTO reconnectCreature; }; @@ -398,7 +398,7 @@ struct SignalTO int numTimesSent; }; -struct StructureTO +struct SolidTO { float energy; }; @@ -432,7 +432,7 @@ struct CellTO uint16_t geneIndex; // Cell type data - uint64_t neuralNetworkDataIndex; // May be invalid (not used for structure and base cells) + uint64_t neuralNetworkDataIndex; // May be invalid (not used for solid and base cells) CellType cellType; CellTypeDataTO cellTypeData; bool constructorAvailable; // If true, constructor holds valid data @@ -453,7 +453,7 @@ struct CellTO union ObjectTypeDataTO { - StructureTO structure; + SolidTO solid; FluidTO fluid; FreeCellTO freeCell; CellTO cell; diff --git a/source/EngineImpl/DescConverterService.cpp b/source/EngineImpl/DescConverterService.cpp index 7bb0b8edb5..678f96f47a 100644 --- a/source/EngineImpl/DescConverterService.cpp +++ b/source/EngineImpl/DescConverterService.cpp @@ -306,11 +306,11 @@ ObjectDesc DescConverterService::createObjectDesc(TOs const& to, int objectIndex result._sticky = objectTO.sticky; result._color = objectTO.color; - // Handle object type: Structure, Fluid, FreeCell, or Cell - if (objectTO.type == ObjectType_Structure) { - StructureDesc structureDesc; - structureDesc._energy = objectTO.typeData.structure.energy; - result._type = structureDesc; + // Handle object type: Solid, Fluid, FreeCell, or Cell + if (objectTO.type == ObjectType_Solid) { + SolidDesc solidDesc; + solidDesc._energy = objectTO.typeData.solid.energy; + result._type = solidDesc; } else if (objectTO.type == ObjectType_Fluid) { FluidDesc fluidDesc; @@ -369,9 +369,9 @@ ObjectDesc DescConverterService::createObjectDesc(TOs const& to, int objectIndex DetectEnergyDesc detectEnergy; detectEnergy._minDensity = objectTO.typeData.cell.cellTypeData.sensor.modeData.detectEnergy.minDensity; sensor._mode = detectEnergy; - } else if (objectTO.typeData.cell.cellTypeData.sensor.mode == SensorMode_DetectStructure) { - DetectStructureDesc detectStructure; - sensor._mode = detectStructure; + } else if (objectTO.typeData.cell.cellTypeData.sensor.mode == SensorMode_DetectSolid) { + DetectSolidDesc detectSolid; + sensor._mode = detectSolid; } else if (objectTO.typeData.cell.cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { DetectFreeCellDesc detectFreeCell; detectFreeCell._minDensity = objectTO.typeData.cell.cellTypeData.sensor.modeData.detectFreeCell.minDensity; @@ -499,9 +499,9 @@ ObjectDesc DescConverterService::createObjectDesc(TOs const& to, int objectIndex } break; case CellType_Reconnector: { ReconnectorDesc reconnector; - if (objectTO.typeData.cell.cellTypeData.reconnector.mode == ReconnectorMode_Structure) { - ReconnectStructureDesc reconnectStructure; - reconnector._mode = reconnectStructure; + if (objectTO.typeData.cell.cellTypeData.reconnector.mode == ReconnectorMode_Solid) { + ReconnectSolidDesc reconnectSolid; + reconnector._mode = reconnectSolid; } else if (objectTO.typeData.cell.cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { ReconnectFreeCellDesc reconnectFreeCell; reconnectFreeCell._restrictToColors = @@ -655,9 +655,9 @@ NodeDesc DescConverterService::createNodeDesc(TOs const& to, NodeTO const* nodeT DetectEnergyGenomeDesc detectEnergy; detectEnergy._minDensity = nodeTO->cellTypeData.sensor.modeData.detectEnergy.minDensity; sensorDesc._mode = detectEnergy; - } else if (nodeTO->cellTypeData.sensor.mode == SensorMode_DetectStructure) { - DetectStructureGenomeDesc detectStructure; - sensorDesc._mode = detectStructure; + } else if (nodeTO->cellTypeData.sensor.mode == SensorMode_DetectSolid) { + DetectSolidGenomeDesc detectSolid; + sensorDesc._mode = detectSolid; } else if (nodeTO->cellTypeData.sensor.mode == SensorMode_DetectFreeCell) { DetectFreeCellGenomeDesc detectFreeCell; detectFreeCell._minDensity = nodeTO->cellTypeData.sensor.modeData.detectFreeCell.minDensity; @@ -760,9 +760,9 @@ NodeDesc DescConverterService::createNodeDesc(TOs const& to, NodeTO const* nodeT } break; case CellType_Reconnector: { ReconnectorGenomeDesc reconnectorDesc; - if (nodeTO->cellTypeData.reconnector.mode == ReconnectorMode_Structure) { - ReconnectStructureGenomeDesc reconnectStructure; - reconnectorDesc._mode = reconnectStructure; + if (nodeTO->cellTypeData.reconnector.mode == ReconnectorMode_Solid) { + ReconnectSolidGenomeDesc reconnectSolid; + reconnectorDesc._mode = reconnectSolid; } else if (nodeTO->cellTypeData.reconnector.mode == ReconnectorMode_FreeCell) { ReconnectFreeCellGenomeDesc reconnectFreeCell; reconnectFreeCell._restrictToColors = static_cast(nodeTO->cellTypeData.reconnector.modeData.reconnectFreeCell.restrictToColors); @@ -1022,7 +1022,7 @@ void DescConverterService::convertGenomeToTO( auto const& detectEnergyDesc = std::get(sensorDesc._mode); auto& detectEnergyTO = sensorTO.modeData.detectEnergy; detectEnergyTO.minDensity = detectEnergyDesc._minDensity; - } else if (sensorTO.mode == SensorMode_DetectStructure) { + } else if (sensorTO.mode == SensorMode_DetectSolid) { } else if (sensorTO.mode == SensorMode_DetectFreeCell) { auto const& detectFreeCellDesc = std::get(sensorDesc._mode); auto& detectFreeCellTO = sensorTO.modeData.detectFreeCell; @@ -1117,7 +1117,7 @@ void DescConverterService::convertGenomeToTO( auto const& reconnectorDesc = std::get(nodeDesc._cellType); auto& reconnectorTO = nodeTO.cellTypeData.reconnector; reconnectorTO.mode = reconnectorDesc.getMode(); - if (reconnectorTO.mode == ReconnectorMode_Structure) { + if (reconnectorTO.mode == ReconnectorMode_Solid) { // No data to copy } else if (reconnectorTO.mode == ReconnectorMode_FreeCell) { auto const& reconnectFreeCellDesc = std::get(reconnectorDesc._mode); @@ -1255,10 +1255,10 @@ void DescConverterService::convertObjectToTO( // Set object type objectTO.type = objectDesc.getObjectType(); - // Handle Structure, Fluid, and FreeCell object types - if (objectTO.type == ObjectType_Structure) { - StructureDesc const& structureDesc = objectDesc.getStructureRef(); - objectTO.typeData.structure.energy = structureDesc._energy; + // Handle Solid, Fluid, and FreeCell object types + if (objectTO.type == ObjectType_Solid) { + SolidDesc const& solidDesc = objectDesc.getSolidRef(); + objectTO.typeData.solid.energy = solidDesc._energy; } else if (objectTO.type == ObjectType_Fluid) { FluidDesc const& fluidDesc = objectDesc.getFluidRef(); objectTO.typeData.fluid.energy = fluidDesc._energy; @@ -1325,7 +1325,7 @@ void DescConverterService::convertObjectToTO( auto const& detectEnergyDesc = std::get(sensorDesc._mode); DetectEnergyTO& detectEnergyTO = sensorTO.modeData.detectEnergy; detectEnergyTO.minDensity = detectEnergyDesc._minDensity; - } else if (sensorTO.mode == SensorMode_DetectStructure) { + } else if (sensorTO.mode == SensorMode_DetectSolid) { } else if (sensorTO.mode == SensorMode_DetectFreeCell) { auto const& detectFreeCellDesc = std::get(sensorDesc._mode); DetectFreeCellTO& detectFreeCellTO = sensorTO.modeData.detectFreeCell; @@ -1431,7 +1431,7 @@ void DescConverterService::convertObjectToTO( auto const& reconnectorDesc = std::get(cellDesc._cellType); ReconnectorTO& reconnectorTO = objectTO.typeData.cell.cellTypeData.reconnector; reconnectorTO.mode = reconnectorDesc.getMode(); - if (reconnectorTO.mode == ReconnectorMode_Structure) { + if (reconnectorTO.mode == ReconnectorMode_Solid) { // No data to copy } else if (reconnectorTO.mode == ReconnectorMode_FreeCell) { auto const& reconnectFreeCellDesc = std::get(reconnectorDesc._mode); diff --git a/source/EngineInterface/CellTypeConstants.h b/source/EngineInterface/CellTypeConstants.h index 3c7ec213f3..954c2f18f9 100644 --- a/source/EngineInterface/CellTypeConstants.h +++ b/source/EngineInterface/CellTypeConstants.h @@ -18,7 +18,7 @@ namespace Channels using ObjectType = int; enum ObjectType_ { - ObjectType_Structure, + ObjectType_Solid, ObjectType_Fluid, ObjectType_FreeCell, ObjectType_Cell, @@ -64,7 +64,7 @@ namespace Const "Void"}; std::vector const ObjectTypeStrings = { - "Structure", + "Solid", "Fluid", "Free Cell", "Cell"}; @@ -237,7 +237,7 @@ enum SensorMode_ { SensorMode_Telemetry, SensorMode_DetectEnergy, - SensorMode_DetectStructure, + SensorMode_DetectSolid, SensorMode_DetectFreeCell, SensorMode_DetectCreature, SensorMode_Count, @@ -245,7 +245,7 @@ enum SensorMode_ namespace Const { - std::vector const SensorModeStrings = {"Telemetry", "Detect energy", "Detect structure", "Detect free cell", "Detect creature"}; + std::vector const SensorModeStrings = {"Telemetry", "Detect energy", "Detect solid", "Detect free cell", "Detect creature"}; } //******************** @@ -350,7 +350,7 @@ enum DetonatorState_ using ReconnectorMode = int; enum ReconnectorMode_ { - ReconnectorMode_Structure, + ReconnectorMode_Solid, ReconnectorMode_FreeCell, ReconnectorMode_Creature, ReconnectorMode_Count, @@ -358,7 +358,7 @@ enum ReconnectorMode_ namespace Const { - std::vector const ReconnectorModeStrings = {"Structure", "Free cell", "Creature"}; + std::vector const ReconnectorModeStrings = {"Solid", "Free cell", "Creature"}; } namespace Channels diff --git a/source/EngineInterface/CellTypeStrings.h b/source/EngineInterface/CellTypeStrings.h index 107985ab5c..06ee2d7e2e 100644 --- a/source/EngineInterface/CellTypeStrings.h +++ b/source/EngineInterface/CellTypeStrings.h @@ -46,7 +46,7 @@ namespace Const }; std::map const ObjectTypeToStringMap = { - {ObjectType_Structure, "Structure"}, + {ObjectType_Solid, "Solid"}, {ObjectType_Fluid, "Fluid"}, {ObjectType_FreeCell, "Free Cell"}, {ObjectType_Cell, "Cell"}, diff --git a/source/EngineInterface/Desc.cpp b/source/EngineInterface/Desc.cpp index c27c853201..d93651541a 100644 --- a/source/EngineInterface/Desc.cpp +++ b/source/EngineInterface/Desc.cpp @@ -62,8 +62,8 @@ SensorMode SensorDesc::getMode() const return SensorMode_Telemetry; } else if (std::holds_alternative(_mode)) { return SensorMode_DetectEnergy; - } else if (std::holds_alternative(_mode)) { - return SensorMode_DetectStructure; + } else if (std::holds_alternative(_mode)) { + return SensorMode_DetectSolid; } else if (std::holds_alternative(_mode)) { return SensorMode_DetectFreeCell; } else if (std::holds_alternative(_mode)) { @@ -92,8 +92,8 @@ MuscleMode MuscleDesc::getMode() const ReconnectorMode ReconnectorDesc::getMode() const { - if (std::holds_alternative(_mode)) { - return ReconnectorMode_Structure; + if (std::holds_alternative(_mode)) { + return ReconnectorMode_Solid; } else if (std::holds_alternative(_mode)) { return ReconnectorMode_FreeCell; } else if (std::holds_alternative(_mode)) { @@ -213,8 +213,8 @@ ObjectDesc ObjectDesc::id(uint64_t id) ObjectType ObjectDesc::getObjectType() const { - if (std::holds_alternative(_type)) { - return ObjectType_Structure; + if (std::holds_alternative(_type)) { + return ObjectType_Solid; } else if (std::holds_alternative(_type)) { return ObjectType_Fluid; } else if (std::holds_alternative(_type)) { @@ -225,14 +225,14 @@ ObjectType ObjectDesc::getObjectType() const CHECK(false); } -StructureDesc& ObjectDesc::getStructureRef() +SolidDesc& ObjectDesc::getSolidRef() { - return std::get(_type); + return std::get(_type); } -StructureDesc const& ObjectDesc::getStructureRef() const +SolidDesc const& ObjectDesc::getSolidRef() const { - return std::get(_type); + return std::get(_type); } FluidDesc& ObjectDesc::getFluidRef() diff --git a/source/EngineInterface/Desc.h b/source/EngineInterface/Desc.h index 6ed9052215..5d204f3e2a 100644 --- a/source/EngineInterface/Desc.h +++ b/source/EngineInterface/Desc.h @@ -84,9 +84,9 @@ struct DetectEnergyDesc MEMBER(DetectEnergyDesc, float, minDensity, 0.05f); }; -struct DetectStructureDesc +struct DetectSolidDesc { - auto operator<=>(DetectStructureDesc const&) const = default; + auto operator<=>(DetectSolidDesc const&) const = default; }; struct DetectFreeCellDesc @@ -107,7 +107,7 @@ struct DetectCreatureDesc MEMBER(DetectCreatureDesc, LineageRestriction, restrictToLineage, LineageRestriction_No); }; -using SensorModeDesc = std::variant; +using SensorModeDesc = std::variant; struct SensorLastMatchDesc { @@ -289,9 +289,9 @@ struct DefenderDesc MEMBER(DefenderDesc, DefenderMode, mode, DefenderMode_DefendAgainstAttacker); }; -struct ReconnectStructureDesc +struct ReconnectSolidDesc { - auto operator<=>(ReconnectStructureDesc const&) const = default; + auto operator<=>(ReconnectSolidDesc const&) const = default; }; struct ReconnectFreeCellDesc @@ -311,7 +311,7 @@ struct ReconnectCreatureDesc MEMBER(ReconnectCreatureDesc, LineageRestriction, restrictToLineage, LineageRestriction_No); }; -using ReconnectorModeDesc = std::variant; +using ReconnectorModeDesc = std::variant; struct ReconnectorDesc { @@ -457,11 +457,11 @@ struct SignalDesc MEMBER(SignalDesc, int, numTimesSent, 0); }; -struct StructureDesc +struct SolidDesc { - auto operator<=>(StructureDesc const&) const = default; + auto operator<=>(SolidDesc const&) const = default; - MEMBER(StructureDesc, float, energy, 100.0f); + MEMBER(SolidDesc, float, energy, 100.0f); }; struct FluidDesc @@ -522,7 +522,7 @@ struct CellDesc CellType getCellType() const; }; -using ObjectTypeDesc = std::variant; +using ObjectTypeDesc = std::variant; struct ObjectDesc { @@ -542,8 +542,8 @@ struct ObjectDesc ObjectType getObjectType() const; - StructureDesc& getStructureRef(); - StructureDesc const& getStructureRef() const; + SolidDesc& getSolidRef(); + SolidDesc const& getSolidRef() const; FluidDesc& getFluidRef(); FluidDesc const& getFluidRef() const; FreeCellDesc& getFreeCellRef(); diff --git a/source/EngineInterface/DescEditService.cpp b/source/EngineInterface/DescEditService.cpp index f8a2336ab7..fc8ed11290 100644 --- a/source/EngineInterface/DescEditService.cpp +++ b/source/EngineInterface/DescEditService.cpp @@ -464,8 +464,8 @@ void DescEditService::randomizeEnergies(Desc& description, float minEnergy, floa object.getCellRef()._usableEnergy = energy; } else if (type == ObjectType_FreeCell) { object.getFreeCellRef()._energy = energy; - } else if (type == ObjectType_Structure) { - object.getStructureRef()._energy = energy; + } else if (type == ObjectType_Solid) { + object.getSolidRef()._energy = energy; } else if (type == ObjectType_Fluid) { object.getFluidRef()._energy = energy; } diff --git a/source/EngineInterface/DescEditService.h b/source/EngineInterface/DescEditService.h index ff1a8ec3ec..ee169befcb 100644 --- a/source/EngineInterface/DescEditService.h +++ b/source/EngineInterface/DescEditService.h @@ -14,7 +14,7 @@ class DescEditService { MEMBER(CreateRectParameters, int, width, 10); MEMBER(CreateRectParameters, int, height, 10); - MEMBER(CreateRectParameters, ObjectTypeDesc, objectType, StructureDesc()); + MEMBER(CreateRectParameters, ObjectTypeDesc, objectType, SolidDesc()); MEMBER(CreateRectParameters, float, cellDistance, 1.0f); MEMBER(CreateRectParameters, bool, connectObjects, true); MEMBER(CreateRectParameters, float, stiffness, 1.0f); @@ -28,7 +28,7 @@ class DescEditService struct CreateHexParameters { MEMBER(CreateHexParameters, int, layers, 10); - MEMBER(CreateHexParameters, ObjectTypeDesc, objectType, StructureDesc()); + MEMBER(CreateHexParameters, ObjectTypeDesc, objectType, SolidDesc()); MEMBER(CreateHexParameters, float, cellDistance, 1.0f); MEMBER(CreateHexParameters, bool, connectObjects, true); MEMBER(CreateHexParameters, float, stiffness, 1.0f); @@ -41,7 +41,7 @@ class DescEditService struct CreateCircleParameters { - MEMBER(CreateCircleParameters, ObjectTypeDesc, type, StructureDesc()); + MEMBER(CreateCircleParameters, ObjectTypeDesc, type, SolidDesc()); MEMBER(CreateCircleParameters, float, radius, 3.0f); MEMBER(CreateCircleParameters, float, cellDistance, 1.0f); MEMBER(CreateCircleParameters, bool, connectObjects, true); diff --git a/source/EngineInterface/GenomeDesc.cpp b/source/EngineInterface/GenomeDesc.cpp index 485baff02e..8c154e5829 100644 --- a/source/EngineInterface/GenomeDesc.cpp +++ b/source/EngineInterface/GenomeDesc.cpp @@ -53,8 +53,8 @@ SensorMode SensorGenomeDesc::getMode() const return SensorMode_Telemetry; } else if (std::holds_alternative(_mode)) { return SensorMode_DetectEnergy; - } else if (std::holds_alternative(_mode)) { - return SensorMode_DetectStructure; + } else if (std::holds_alternative(_mode)) { + return SensorMode_DetectSolid; } else if (std::holds_alternative(_mode)) { return SensorMode_DetectFreeCell; } else if (std::holds_alternative(_mode)) { @@ -83,8 +83,8 @@ MuscleMode MuscleGenomeDesc::getMode() const ReconnectorMode ReconnectorGenomeDesc::getMode() const { - if (std::holds_alternative(_mode)) { - return ReconnectorMode_Structure; + if (std::holds_alternative(_mode)) { + return ReconnectorMode_Solid; } else if (std::holds_alternative(_mode)) { return ReconnectorMode_FreeCell; } else if (std::holds_alternative(_mode)) { diff --git a/source/EngineInterface/GenomeDesc.h b/source/EngineInterface/GenomeDesc.h index ee2c5453d7..a9f3b71b01 100644 --- a/source/EngineInterface/GenomeDesc.h +++ b/source/EngineInterface/GenomeDesc.h @@ -66,9 +66,9 @@ struct DetectEnergyGenomeDesc MEMBER(DetectEnergyGenomeDesc, float, minDensity, 1.0f); }; -struct DetectStructureGenomeDesc +struct DetectSolidGenomeDesc { - auto operator<=>(DetectStructureGenomeDesc const&) const = default; + auto operator<=>(DetectSolidGenomeDesc const&) const = default; }; struct DetectFreeCellGenomeDesc @@ -90,7 +90,7 @@ struct DetectCreatureGenomeDesc }; using SensorModeGenomeDesc = - std::variant; + std::variant; struct SensorGenomeDesc { @@ -228,9 +228,9 @@ struct DefenderGenomeDesc MEMBER(DefenderGenomeDesc, DefenderMode, mode, DefenderMode_DefendAgainstAttacker); }; -struct ReconnectStructureGenomeDesc +struct ReconnectSolidGenomeDesc { - auto operator<=>(ReconnectStructureGenomeDesc const&) const = default; + auto operator<=>(ReconnectSolidGenomeDesc const&) const = default; }; struct ReconnectFreeCellGenomeDesc @@ -250,7 +250,7 @@ struct ReconnectCreatureGenomeDesc MEMBER(ReconnectCreatureGenomeDesc, LineageRestriction, restrictToLineage, LineageRestriction_No); }; -using ReconnectorModeGenomeDesc = std::variant; +using ReconnectorModeGenomeDesc = std::variant; struct ReconnectorGenomeDesc { diff --git a/source/EngineInterface/GenomeDescHash.h b/source/EngineInterface/GenomeDescHash.h index 734594a5f3..63d04ca36f 100644 --- a/source/EngineInterface/GenomeDescHash.h +++ b/source/EngineInterface/GenomeDescHash.h @@ -80,7 +80,7 @@ struct std::hash if (desc.getMode() == SensorMode_DetectEnergy) { auto const& mode = std::get(desc._mode); hash_combine(seed, mode._minDensity); - } else if (desc.getMode() == SensorMode_DetectStructure) { + } else if (desc.getMode() == SensorMode_DetectSolid) { // No additional data } else if (desc.getMode() == SensorMode_DetectFreeCell) { auto const& mode = std::get(desc._mode); @@ -282,9 +282,9 @@ struct std::hash }; template <> -struct std::hash +struct std::hash { - std::size_t operator()(ReconnectStructureGenomeDesc const& desc) const { return 0; } + std::size_t operator()(ReconnectSolidGenomeDesc const& desc) const { return 0; } }; template <> @@ -325,7 +325,7 @@ struct std::hash { std::size_t operator()(ReconnectorModeGenomeDesc const& desc) const { - return variant_hasher{}(desc); + return variant_hasher{}(desc); } }; diff --git a/source/EngineInterface/GeometryBuffers.h b/source/EngineInterface/GeometryBuffers.h index bc56d00ed0..31c3daf354 100644 --- a/source/EngineInterface/GeometryBuffers.h +++ b/source/EngineInterface/GeometryBuffers.h @@ -24,7 +24,7 @@ struct ObjectVertexData float pos[3]; // x, y, z position (z used for lighting) float color[3]; // r, g, b color int state; // Bit 0..7 = cell type - // Bit 8..15 = object type (ObjectType_Structure, ObjectType_FreeCell, ObjectType_Cell) + // Bit 8..15 = object type (ObjectType_Solid, ObjectType_FreeCell, ObjectType_Cell) // Bit 16 = is isolated (zero connections) float signalChanges; // signal changes in [0, 1] }; diff --git a/source/EngineInterfaceTests/DescEditServiceTests.cpp b/source/EngineInterfaceTests/DescEditServiceTests.cpp index 3e510bc6b0..c61847a168 100644 --- a/source/EngineInterfaceTests/DescEditServiceTests.cpp +++ b/source/EngineInterfaceTests/DescEditServiceTests.cpp @@ -45,10 +45,10 @@ TEST_F(DescEditServiceTests, reconnectObjects_noCrossingConnections) { // Arrange: 4 objects in a square where diagonals would cross auto desc = Desc().objects({ - ObjectDesc().pos({0.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({0.0f, 1.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 1.0f}).type(StructureDesc()), + ObjectDesc().pos({0.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({0.0f, 1.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 1.0f}).type(SolidDesc()), }); // Act: reconnect with distance that includes diagonals (sqrt(2) ~ 1.414) @@ -62,15 +62,15 @@ TEST_F(DescEditServiceTests, reconnectObjects_noCrossingConnections_largerGrid) { // Arrange: 3x3 grid of objects auto desc = Desc().objects({ - ObjectDesc().pos({0.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({2.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({0.0f, 1.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 1.0f}).type(StructureDesc()), - ObjectDesc().pos({2.0f, 1.0f}).type(StructureDesc()), - ObjectDesc().pos({0.0f, 2.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 2.0f}).type(StructureDesc()), - ObjectDesc().pos({2.0f, 2.0f}).type(StructureDesc()), + ObjectDesc().pos({0.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({2.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({0.0f, 1.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 1.0f}).type(SolidDesc()), + ObjectDesc().pos({2.0f, 1.0f}).type(SolidDesc()), + ObjectDesc().pos({0.0f, 2.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 2.0f}).type(SolidDesc()), + ObjectDesc().pos({2.0f, 2.0f}).type(SolidDesc()), }); // Act: reconnect with distance that includes diagonals @@ -84,10 +84,10 @@ TEST_F(DescEditServiceTests, reconnectObjects_adjacentConnectionsStillCreated) { // Arrange: 4 objects in a square auto desc = Desc().objects({ - ObjectDesc().pos({0.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 0.0f}).type(StructureDesc()), - ObjectDesc().pos({0.0f, 1.0f}).type(StructureDesc()), - ObjectDesc().pos({1.0f, 1.0f}).type(StructureDesc()), + ObjectDesc().pos({0.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 0.0f}).type(SolidDesc()), + ObjectDesc().pos({0.0f, 1.0f}).type(SolidDesc()), + ObjectDesc().pos({1.0f, 1.0f}).type(SolidDesc()), }); // Act: reconnect with distance that only includes adjacent (not diagonals) diff --git a/source/EngineTestData/DescTestDataFactory.cpp b/source/EngineTestData/DescTestDataFactory.cpp index 719dbd9848..64b0c5f4ca 100644 --- a/source/EngineTestData/DescTestDataFactory.cpp +++ b/source/EngineTestData/DescTestDataFactory.cpp @@ -9,14 +9,14 @@ std::vector DescTestDataFactory::getAllObjectParameters() const { return { - ObjectParameter{ObjectType_Structure}, + ObjectParameter{ObjectType_Solid}, ObjectParameter{ObjectType_Fluid}, ObjectParameter{ObjectType_FreeCell}, ObjectParameter{ObjectType_Cell, CellType_Base}, ObjectParameter{ObjectType_Cell, CellType_Depot}, ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_Telemetry}}, ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_DetectEnergy}}, - ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_DetectStructure}}, + ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_DetectSolid}}, ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_DetectFreeCell}}, ObjectParameter{ObjectType_Cell, CellType_Sensor, SensorModeWrapper{SensorMode_DetectCreature}}, ObjectParameter{ObjectType_Cell, CellType_Generator, GeneratorModeWrapper{GeneratorMode_SquareSignal}}, @@ -30,7 +30,7 @@ std::vector DescTestDataFactory::getAllObj ObjectParameter{ObjectType_Cell, CellType_Muscle, MuscleModeWrapper{MuscleMode_ManualCrawling}}, ObjectParameter{ObjectType_Cell, CellType_Muscle, MuscleModeWrapper{MuscleMode_DirectMovement}}, ObjectParameter{ObjectType_Cell, CellType_Defender}, - ObjectParameter{ObjectType_Cell, CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Structure}}, + ObjectParameter{ObjectType_Cell, CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Solid}}, ObjectParameter{ObjectType_Cell, CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_FreeCell}}, ObjectParameter{ObjectType_Cell, CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Creature}}, ObjectParameter{ObjectType_Cell, CellType_Detonator}, @@ -48,8 +48,8 @@ std::vector DescTestDataFactory::getAllObj ObjectDesc DescTestDataFactory::createNonDefaultObjectDesc(ObjectParameter objectParameter) const { switch (objectParameter.objectType) { - case ObjectType_Structure: - return ObjectDesc().pos({0.5f, 0.8f}).vel({-0.3f, 0.7f}).color(3).fixed(true).type(StructureDesc().energy(42.0f)); + case ObjectType_Solid: + return ObjectDesc().pos({0.5f, 0.8f}).vel({-0.3f, 0.7f}).color(3).fixed(true).type(SolidDesc().energy(42.0f)); case ObjectType_Fluid: return ObjectDesc().pos({0.5f, 0.8f}).vel({-0.3f, 0.7f}).color(3).fixed(true).type(FluidDesc().energy(42.0f).glow(1.0f)); case ObjectType_FreeCell: @@ -113,7 +113,7 @@ std::vector DescTestDataFactory::getAllNodeP NodeParameter{CellType_Depot}, NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_Telemetry}}, NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_DetectEnergy}}, - NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_DetectStructure}}, + NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_DetectSolid}}, NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_DetectFreeCell}}, NodeParameter{CellType_Sensor, SensorModeWrapper{SensorMode_DetectCreature}}, NodeParameter{CellType_Generator, GeneratorModeWrapper{GeneratorMode_SquareSignal}}, @@ -127,7 +127,7 @@ std::vector DescTestDataFactory::getAllNodeP NodeParameter{CellType_Muscle, MuscleModeWrapper{MuscleMode_ManualCrawling}}, NodeParameter{CellType_Muscle, MuscleModeWrapper{MuscleMode_DirectMovement}}, NodeParameter{CellType_Defender}, - NodeParameter{CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Structure}}, + NodeParameter{CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Solid}}, NodeParameter{CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_FreeCell}}, NodeParameter{CellType_Reconnector, ReconnectorModeWrapper{ReconnectorMode_Creature}}, NodeParameter{CellType_Detonator}, @@ -280,7 +280,7 @@ bool DescTestDataFactory::compare(ObjectDesc const& object, NodeDesc const& node return false; } } break; - case SensorMode_DetectStructure: { + case SensorMode_DetectSolid: { // No fields to compare } break; case SensorMode_DetectFreeCell: { @@ -471,7 +471,7 @@ bool DescTestDataFactory::compare(ObjectDesc const& object, NodeDesc const& node return false; } switch (reconnector.getMode()) { - case ReconnectorMode_Structure: { + case ReconnectorMode_Solid: { // No fields to compare } break; case ReconnectorMode_FreeCell: { @@ -653,7 +653,7 @@ CellTypeDesc DescTestDataFactory::createNonDefaultCellTypeDesc(ObjectParameter o auto generatorMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value : GeneratorMode_SquareSignal; auto reconnectorMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value - : ReconnectorMode_Structure; + : ReconnectorMode_Solid; auto memoryMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value : MemoryMode_SignalDelay; @@ -671,8 +671,8 @@ CellTypeDesc DescTestDataFactory::createNonDefaultCellTypeDesc(ObjectParameter o case SensorMode_DetectEnergy: sensorModeDesc = DetectEnergyDesc().minDensity(0.3f); break; - case SensorMode_DetectStructure: - sensorModeDesc = DetectStructureDesc(); + case SensorMode_DetectSolid: + sensorModeDesc = DetectSolidDesc(); break; case SensorMode_DetectFreeCell: sensorModeDesc = DetectFreeCellDesc().minDensity(0.25f).restrictToColors(1 << 2); @@ -745,8 +745,8 @@ CellTypeDesc DescTestDataFactory::createNonDefaultCellTypeDesc(ObjectParameter o case CellType_Reconnector: { ReconnectorModeDesc reconnectorModeDesc; switch (reconnectorMode) { - case ReconnectorMode_Structure: - reconnectorModeDesc = ReconnectStructureDesc(); + case ReconnectorMode_Solid: + reconnectorModeDesc = ReconnectSolidDesc(); break; case ReconnectorMode_FreeCell: reconnectorModeDesc = ReconnectFreeCellDesc().restrictToColors(1 << 2); @@ -826,7 +826,7 @@ CellTypeGenomeDesc DescTestDataFactory::createNonDefaultCellTypeGenomeDesc(NodeP auto generatorMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value : GeneratorMode_SquareSignal; auto reconnectorMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value - : ReconnectorMode_Structure; + : ReconnectorMode_Solid; auto memoryMode = std::holds_alternative(objectParameter.mode) ? std::get(objectParameter.mode).value : MemoryMode_SignalDelay; switch (type) { @@ -843,8 +843,8 @@ CellTypeGenomeDesc DescTestDataFactory::createNonDefaultCellTypeGenomeDesc(NodeP case SensorMode_DetectEnergy: sensorModeDesc = DetectEnergyGenomeDesc().minDensity(0.25f); break; - case SensorMode_DetectStructure: - sensorModeDesc = DetectStructureGenomeDesc(); + case SensorMode_DetectSolid: + sensorModeDesc = DetectSolidGenomeDesc(); break; case SensorMode_DetectFreeCell: sensorModeDesc = DetectFreeCellGenomeDesc().minDensity(0.20f).restrictToColors(1 << 6); @@ -909,8 +909,8 @@ CellTypeGenomeDesc DescTestDataFactory::createNonDefaultCellTypeGenomeDesc(NodeP case CellType_Reconnector: { ReconnectorModeGenomeDesc reconnectorModeDesc; switch (reconnectorMode) { - case ReconnectorMode_Structure: - reconnectorModeDesc = ReconnectStructureGenomeDesc(); + case ReconnectorMode_Solid: + reconnectorModeDesc = ReconnectSolidGenomeDesc(); break; case ReconnectorMode_FreeCell: reconnectorModeDesc = ReconnectFreeCellGenomeDesc().restrictToColors(1 << 6); diff --git a/source/EngineTests/CellStateTransitionTests.cpp b/source/EngineTests/CellStateTransitionTests.cpp index 46856e6c38..f2f2726c23 100644 --- a/source/EngineTests/CellStateTransitionTests.cpp +++ b/source/EngineTests/CellStateTransitionTests.cpp @@ -26,8 +26,8 @@ class CellStateTransitionTests : public IntegrationTestFramework ObjectTypeDesc getObjectTypeDesc(ObjectType objectType) { - if (objectType == ObjectType_Structure) { - return StructureDesc(); + if (objectType == ObjectType_Solid) { + return SolidDesc(); } else if (objectType == ObjectType_Fluid) { return FluidDesc(); } else if (objectType == ObjectType_FreeCell) { @@ -154,7 +154,7 @@ TEST_P(CellStateTransitionTests_AllStates, structure_cell) auto data = Desc() .addObjects({ - ObjectDesc().id(1).pos({10.0f, 10.0f}).type(StructureDesc()), + ObjectDesc().id(1).pos({10.0f, 10.0f}).type(SolidDesc()), }) .addCreature({ ObjectDesc().id(2).pos({11.0f, 10.0f}).type(CellDesc().cellState(cellState)), diff --git a/source/EngineTests/DataTransferTests.cpp b/source/EngineTests/DataTransferTests.cpp index c9e0f156c2..86a14e7a23 100644 --- a/source/EngineTests/DataTransferTests.cpp +++ b/source/EngineTests/DataTransferTests.cpp @@ -145,7 +145,7 @@ TEST_F(DataTransferTests, multipleCells_genome_multipleGenes_multipleNodes) TEST_F(DataTransferTests, setSimulationData_keepIdsStable) { auto data = - Desc().objects({ObjectDesc().id(0).type(StructureDesc()), ObjectDesc().id(1).type(FreeCellDesc())}).energies({EnergyDesc().id(2), EnergyDesc().id(3)}); + Desc().objects({ObjectDesc().id(0).type(SolidDesc()), ObjectDesc().id(1).type(FreeCellDesc())}).energies({EnergyDesc().id(2), EnergyDesc().id(3)}); data.addCreature({ObjectDesc().id(5)}, CreatureDesc().id(4), GenomeDesc()); data.addCreature({ObjectDesc().id(6)}, CreatureDesc().id(5), GenomeDesc()); @@ -335,7 +335,7 @@ TEST_F(DataTransferTests, getInspectedSimulationData) TEST_F(DataTransferTests, adaptIdGenerator_objects) { auto constexpr HighId = 1000000; - auto data = Desc().objects({ObjectDesc().id(HighId).type(StructureDesc())}); + auto data = Desc().objects({ObjectDesc().id(HighId).type(SolidDesc())}); _simulationFacade->setSimulationData(data); NumberGenerator::get().setIds({1}); diff --git a/source/EngineTests/EditTests.cpp b/source/EngineTests/EditTests.cpp index 3941867281..3503ad1e92 100644 --- a/source/EngineTests/EditTests.cpp +++ b/source/EngineTests/EditTests.cpp @@ -100,8 +100,8 @@ TEST_F(EditTests, getSelectionShallowData_selectMixed) { auto data = Desc() .addObjects({ - ObjectDesc().id(1).pos({50, 50}).type(StructureDesc()), - ObjectDesc().id(2).pos({51, 50}).type(StructureDesc()), + ObjectDesc().id(1).pos({50, 50}).type(SolidDesc()), + ObjectDesc().id(2).pos({51, 50}).type(SolidDesc()), }) .energies({ EnergyDesc().id(3).pos({52, 50}).energy(10.0f), diff --git a/source/EngineTests/IntegrationTestFramework.cpp b/source/EngineTests/IntegrationTestFramework.cpp index 246b8adece..3072c8abb3 100644 --- a/source/EngineTests/IntegrationTestFramework.cpp +++ b/source/EngineTests/IntegrationTestFramework.cpp @@ -74,8 +74,8 @@ double IntegrationTestFramework::getEnergy(Desc const& data) const result += cell._usableEnergy + cell._rawEnergy + cell._reservedEnergy + getDepotEnergy(object); } else if (object.getObjectType() == ObjectType_FreeCell) { result += object.getFreeCellRef()._energy; - } else if (object.getObjectType() == ObjectType_Structure) { - result += object.getStructureRef()._energy; + } else if (object.getObjectType() == ObjectType_Solid) { + result += object.getSolidRef()._energy; } else if (object.getObjectType() == ObjectType_Fluid) { result += object.getFluidRef()._energy; } diff --git a/source/EngineTests/ObjectConnectionTests.cpp b/source/EngineTests/ObjectConnectionTests.cpp index 315bf4913d..4e3a862213 100644 --- a/source/EngineTests/ObjectConnectionTests.cpp +++ b/source/EngineTests/ObjectConnectionTests.cpp @@ -39,8 +39,8 @@ TEST_F(ObjectConnectionTests, decay) TEST_F(ObjectConnectionTests, addFirstConnection) { auto data = Desc().objects({ - ObjectDesc().id(1).pos({0, 0}).type(StructureDesc()), - ObjectDesc().id(2).pos({1, 0}).type(StructureDesc()), + ObjectDesc().id(1).pos({0, 0}).type(SolidDesc()), + ObjectDesc().id(2).pos({1, 0}).type(SolidDesc()), }); _simulationFacade->setSimulationData(data); @@ -64,9 +64,9 @@ TEST_F(ObjectConnectionTests, addFirstConnection) TEST_F(ObjectConnectionTests, addSecondConnection) { auto data = Desc().objects({ - ObjectDesc().id(1).pos({0, 0}).type(StructureDesc()), - ObjectDesc().id(2).pos({1, 0}).type(StructureDesc()), - ObjectDesc().id(3).pos({0, 1}).type(StructureDesc()), + ObjectDesc().id(1).pos({0, 0}).type(SolidDesc()), + ObjectDesc().id(2).pos({1, 0}).type(SolidDesc()), + ObjectDesc().id(3).pos({0, 1}).type(SolidDesc()), }); data.addConnection(1, 2); _simulationFacade->setSimulationData(data); @@ -90,10 +90,10 @@ TEST_F(ObjectConnectionTests, addSecondConnection) TEST_F(ObjectConnectionTests, addThirdConnection1) { auto data = Desc().objects({ - ObjectDesc().id(1).pos({0, 0}).type(StructureDesc()), - ObjectDesc().id(2).pos({1, 0}).type(StructureDesc()), - ObjectDesc().id(3).pos({0, 1}).type(StructureDesc()), - ObjectDesc().id(4).pos({0, -1}).type(StructureDesc()), + ObjectDesc().id(1).pos({0, 0}).type(SolidDesc()), + ObjectDesc().id(2).pos({1, 0}).type(SolidDesc()), + ObjectDesc().id(3).pos({0, 1}).type(SolidDesc()), + ObjectDesc().id(4).pos({0, -1}).type(SolidDesc()), }); data.addConnection(1, 2); data.addConnection(1, 3); @@ -123,10 +123,10 @@ TEST_F(ObjectConnectionTests, addThirdConnection1) TEST_F(ObjectConnectionTests, addThirdConnection2) { auto data = Desc().objects({ - ObjectDesc().id(1).pos({0, 0}).type(StructureDesc()), - ObjectDesc().id(2).pos({1, 0}).type(StructureDesc()), - ObjectDesc().id(3).pos({-1, 0}).type(StructureDesc()), - ObjectDesc().id(4).pos({0, 1}).type(StructureDesc()), + ObjectDesc().id(1).pos({0, 0}).type(SolidDesc()), + ObjectDesc().id(2).pos({1, 0}).type(SolidDesc()), + ObjectDesc().id(3).pos({-1, 0}).type(SolidDesc()), + ObjectDesc().id(4).pos({0, 1}).type(SolidDesc()), }); data.addConnection(1, 2); data.addConnection(1, 3); diff --git a/source/EngineTests/RadiationTests.cpp b/source/EngineTests/RadiationTests.cpp index 12ebbc6e2a..5c59d0033d 100644 --- a/source/EngineTests/RadiationTests.cpp +++ b/source/EngineTests/RadiationTests.cpp @@ -54,11 +54,11 @@ TEST_F(RadiationTests, structureCells_shouldNotRadiate) { Desc data; data._objects.emplace_back( - ObjectDesc().id(1).pos({100.0f, 100.0f}).vel({0.0f, 0.0f}).color(0).type(StructureDesc())); + ObjectDesc().id(1).pos({100.0f, 100.0f}).vel({0.0f, 0.0f}).color(0).type(SolidDesc())); _simulationFacade->setSimulationData(data); - // Run simulation for many timesteps - structure cells should not lose energy to radiation + // Run simulation for many timesteps - solid cells should not lose energy to radiation _simulationFacade->calcTimesteps(1000); auto actualData = _simulationFacade->getSimulationData(); @@ -66,10 +66,10 @@ TEST_F(RadiationTests, structureCells_shouldNotRadiate) // Verify no particles were created (no radiation emitted) EXPECT_EQ(0, actualData._energies.size()); - // Verify the structure cell is still present + // Verify the solid cell is still present EXPECT_EQ(1, actualData._objects.size()); auto const& object = actualData._objects.at(0); - EXPECT_EQ(ObjectType_Structure, object.getObjectType()); + EXPECT_EQ(ObjectType_Solid, object.getObjectType()); } TEST_F(RadiationTests, baseCells_shouldRadiate) diff --git a/source/EngineTests/ReconnectorTests.cpp b/source/EngineTests/ReconnectorTests.cpp index 2d6cc64abe..556b878a8d 100644 --- a/source/EngineTests/ReconnectorTests.cpp +++ b/source/EngineTests/ReconnectorTests.cpp @@ -62,16 +62,16 @@ class ReconnectorTests : public IntegrationTestFramework }; //******************************************* -//* Structure mode tests +//* Solid mode tests //******************************************* TEST_F(ReconnectorTests, structureMode_connectToStructure) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); - // Add two connected structure cells within range - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells within range + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); _simulationFacade->setSimulationData(data); @@ -86,9 +86,9 @@ TEST_F(ReconnectorTests, structureMode_connectToStructure) TEST_F(ReconnectorTests, structureMode_ignoreNonStructure) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); - // Add free cell (non-structure) within range + // Add free cell (non-solid) within range data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(FreeCellDesc())); _simulationFacade->setSimulationData(data); @@ -103,7 +103,7 @@ TEST_F(ReconnectorTests, structureMode_ignoreNonStructure) TEST_F(ReconnectorTests, structureMode_ignoreFluidParticle) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); // Add fluid particle within range data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(FluidDesc())); @@ -122,11 +122,11 @@ TEST_F(ReconnectorTests, structureMode_ignoreFluidParticle) TEST_F(ReconnectorTests, structureMode_outOfRange) { auto range = _parameters.reconnectorRadius.value[0]; - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); - // Add two connected structure cells outside range - data._objects.emplace_back(ObjectDesc().id(10).pos({100.0f - range - 0.1f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({100.0f - range - 1.1f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells outside range + data._objects.emplace_back(ObjectDesc().id(10).pos({100.0f - range - 0.1f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({100.0f - range - 1.1f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); _simulationFacade->setSimulationData(data); @@ -164,8 +164,8 @@ TEST_F(ReconnectorTests, freeCellMode_ignoreNonFreeCell) { auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectFreeCellDesc()); - // Add structure cell (non-free) within range - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); + // Add solid cell (non-free) within range + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); _simulationFacade->setSimulationData(data); _simulationFacade->calcTimesteps(TIMESTEPS_PER_CELL_FUNCTION); // Wait for generator to trigger @@ -493,9 +493,9 @@ TEST_F(ReconnectorTests, removeConnections_removeStructureConnection) { auto data = createReconnectorWithNegativeSignal({100.0f, 100.0f}, ReconnectCreatureDesc()); - // Add two connected structure cells; the first is connected to the reconnector - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells; the first is connected to the reconnector + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); data.addConnection(1, 10); @@ -505,7 +505,7 @@ TEST_F(ReconnectorTests, removeConnections_removeStructureConnection) auto actualData = _simulationFacade->getSimulationData(); auto actualReconnector = actualData.getObjectRef(1); - // Connection to structure cell should be removed + // Connection to solid cell should be removed EXPECT_FALSE(actualData.hasConnection(1, 10)); // Connection to own creature should remain EXPECT_TRUE(actualData.hasConnection(1, 2)); @@ -589,7 +589,7 @@ TEST_F(ReconnectorTests, removeConnections_keepOwnCreatureConnection) TEST_F(ReconnectorTests, noTrigger_noAction) { // Create reconnector without active signal (no generator) - auto reconnectorCell = ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().cellType(ReconnectorDesc().mode(ReconnectStructureDesc()))); + auto reconnectorCell = ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().cellType(ReconnectorDesc().mode(ReconnectSolidDesc()))); auto data = Desc().addCreature({ reconnectorCell, @@ -597,9 +597,9 @@ TEST_F(ReconnectorTests, noTrigger_noAction) }); data.addConnection(1, 2); - // Add two connected structure cells within range - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells within range + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); _simulationFacade->setSimulationData(data); @@ -613,11 +613,11 @@ TEST_F(ReconnectorTests, noTrigger_noAction) TEST_F(ReconnectorTests, connectsToClosest) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); - // Add two connected structure cells, one closer than the other - data._objects.emplace_back(ObjectDesc().id(10).pos({98.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({99.0f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells, one closer than the other + data._objects.emplace_back(ObjectDesc().id(10).pos({98.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({99.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); _simulationFacade->setSimulationData(data); @@ -632,11 +632,11 @@ TEST_F(ReconnectorTests, connectsToClosest) TEST_F(ReconnectorTests, skipAlreadyConnected) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); - // Add two connected structure cells within range and already connected to reconnector - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(StructureDesc())); + // Add two connected solid cells within range and already connected to reconnector + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); data.addConnection(1, 10); @@ -654,9 +654,9 @@ TEST_F(ReconnectorTests, skipAlreadyConnected) TEST_F(ReconnectorTests, energyConservation) { - auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectStructureDesc()); - data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(StructureDesc())); + auto data = createReconnectorWithPositiveSignal({100.0f, 100.0f}, ReconnectSolidDesc()); + data._objects.emplace_back(ObjectDesc().id(10).pos({99.0f, 100.0f}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(11).pos({98.0f, 100.0f}).type(SolidDesc())); data.addConnection(10, 11); auto originalEnergy = getEnergy(data); @@ -677,7 +677,7 @@ TEST_F(ReconnectorTests, rayNotBlockedByDifferentCreatureConnections) // Create attacker with connections that block the attack ray auto data = Desc().addCreature({ - ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().cellType(ReconnectorDesc().mode(ReconnectStructureDesc()))), + ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().cellType(ReconnectorDesc().mode(ReconnectSolidDesc()))), ObjectDesc().id(2).pos({101.0f, 100.0f}).type(CellDesc().signal({-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})), // Create a connection that crosses the ray path to target at (100, 99) ObjectDesc().id(3).pos({99.0f, 99.0f}), @@ -689,8 +689,8 @@ TEST_F(ReconnectorTests, rayNotBlockedByDifferentCreatureConnections) data.addConnection(1, 4); // Add target creature below (ray to target is blocked by connection 3-4) - data._objects.emplace_back(ObjectDesc().id(10).pos({100.0f, 100.0f - (range - 1.0f)}).type(StructureDesc())); - data._objects.emplace_back(ObjectDesc().id(12).pos({100.0f, 100.0f - range}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().id(10).pos({100.0f, 100.0f - (range - 1.0f)}).type(SolidDesc())); + data._objects.emplace_back(ObjectDesc().id(12).pos({100.0f, 100.0f - range}).type(SolidDesc())); data.addConnection(10, 12); _simulationFacade->setSimulationData(data); diff --git a/source/EngineTests/SensorTests.cpp b/source/EngineTests/SensorTests.cpp index 7d688a0865..e89517bd95 100644 --- a/source/EngineTests/SensorTests.cpp +++ b/source/EngineTests/SensorTests.cpp @@ -23,8 +23,8 @@ class SensorTests : public IntegrationTestFramework { if (mode == SensorMode_DetectEnergy) { return DetectEnergyDesc().minDensity(0.05f); - } else if (mode == SensorMode_DetectStructure) { - return DetectStructureDesc(); + } else if (mode == SensorMode_DetectSolid) { + return DetectSolidDesc(); } else if (mode == SensorMode_DetectFreeCell) { return DetectFreeCellDesc().minDensity(0.05f); } else if (mode == SensorMode_DetectCreature) { @@ -66,11 +66,11 @@ class SensorTests : public IntegrationTestFramework for (int i = 0; i < count; ++i) { data._objects.emplace_back(ObjectDesc().pos({startPos.x + i, startPos.y}).type(FreeCellDesc())); } - } else if (mode == SensorMode_DetectStructure) { + } else if (mode == SensorMode_DetectSolid) { auto baseId = _nextStructureId; _nextStructureId += count; for (int i = 0; i < count; ++i) { - data._objects.emplace_back(ObjectDesc().id(baseId + i).pos({startPos.x + i, startPos.y}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().id(baseId + i).pos({startPos.x + i, startPos.y}).type(SolidDesc())); } for (int i = 0; i < count - 1; ++i) { data.addConnection(baseId + i, baseId + i + 1); @@ -94,7 +94,7 @@ class SensorTests_AllDetectionModes INSTANTIATE_TEST_SUITE_P( SensorTests_AllDetectionModes, SensorTests_AllDetectionModes, - ::testing::Values(SensorMode_DetectEnergy, SensorMode_DetectStructure, SensorMode_DetectFreeCell, SensorMode_DetectCreature)); + ::testing::Values(SensorMode_DetectEnergy, SensorMode_DetectSolid, SensorMode_DetectFreeCell, SensorMode_DetectCreature)); TEST_P(SensorTests_AllDetectionModes, autoTriggered_noTarget) { @@ -488,15 +488,15 @@ TEST_P(SensorTests_AllDetectionModesExceptStructure, rayBlockedByStructureObject CreatureDesc().id(0)); data.addConnection(1, 2); - // Add structure cells between sensor and target (to block the ray) + // Add solid cells between sensor and target (to block the ray) for (int i = 0; i < 10; ++i) { - data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 50.0f}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 50.0f}).type(SolidDesc())); } for (int i = 0; i < 9; ++i) { data.addConnection(50 + i, 50 + i + 1); } - // Add target behind the structure cells + // Add target behind the solid cells addDetectionTargets(data, GetParam(), {98.0f, 20.0f}, 10); _simulationFacade->setSimulationData(data); @@ -504,7 +504,7 @@ TEST_P(SensorTests_AllDetectionModesExceptStructure, rayBlockedByStructureObject auto actualSensor = _simulationFacade->getSimulationData().getObjectRef(1); - // Should not find target because ray is blocked by structure cells + // Should not find target because ray is blocked by solid cells EXPECT_TRUE(approxCompare(0.0f, actualSensor.getCellRef()._signal._channels[Channels::SensorFoundResult])); } @@ -521,15 +521,15 @@ TEST_P(SensorTests_AllDetectionModesExceptStructure, rayNotBlockedByStructureObj CreatureDesc().id(0)); data.addConnection(1, 2); - // Add structure cells behind sensor and target + // Add solid cells behind sensor and target for (int i = 0; i < 10; ++i) { - data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 5.0f}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 5.0f}).type(SolidDesc())); } for (int i = 0; i < 9; ++i) { data.addConnection(50 + i, 50 + i + 1); } - // Add target behind the structure cells + // Add target behind the solid cells addDetectionTargets(data, GetParam(), {98.0f, 20.0f}, 10); _simulationFacade->setSimulationData(data); @@ -555,9 +555,9 @@ TEST_P(SensorTests_AllDetectionModesExceptStructure, rayNotBlockedByStructureObj CreatureDesc().id(0)) .addConnection(1, 2); - // Add structure cells behind sensor and target + // Add solid cells behind sensor and target for (int i = 0; i < 10; ++i) { - data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 150.0f}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().id(50 + i).pos({95.0f + i, 150.0f}).type(SolidDesc())); } for (int i = 0; i < 9; ++i) { data.addConnection(50 + i, 50 + i + 1); @@ -953,17 +953,17 @@ TEST_P(SensorTests_AllDetectionModesExceptStructure, relocation_targetBlocked) auto actualSensor = actualData.getObjectRef(1); EXPECT_TRUE(approxCompare(1.0f, actualSensor.getCellRef()._signal._channels[Channels::SensorFoundResult])); - // Add structure cells between sensor and target to block the ray + // Add solid cells between sensor and target to block the ray actualData = _simulationFacade->getSimulationData(); for (int i = 0; i < 30; ++i) { - actualData._objects.emplace_back(ObjectDesc().id(50 + i).pos({85.0f + i, 70.0f}).type(StructureDesc())); + actualData._objects.emplace_back(ObjectDesc().id(50 + i).pos({85.0f + i, 70.0f}).type(SolidDesc())); } for (int i = 0; i < 29; ++i) { actualData.addConnection(50 + i, 50 + i + 1); } _simulationFacade->setSimulationData(actualData); - // Second scan - target is now blocked by structure cells + // Second scan - target is now blocked by solid cells _simulationFacade->calcTimesteps(TIMESTEPS_PER_CELL_FUNCTION); // Wait for next trigger actualData = _simulationFacade->getSimulationData(); actualSensor = actualData.getObjectRef(1); @@ -1003,19 +1003,19 @@ TEST_F(SensorTests, detectEnergy_targetNotFound_belowMinDensity) } /** - * Tests for SensorMode_DetectStructure (mode-specific tests) + * Tests for SensorMode_DetectSolid (mode-specific tests) */ -TEST_F(SensorTests, detectStructure_ignoreDifferentCellTypes) +TEST_F(SensorTests, detectSolid_ignoreDifferentCellTypes) { auto data = Desc().addCreature( { - ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().frontAngle(0.0f).cellType(SensorDesc().autoTrigger(true).mode(DetectStructureDesc()))), + ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().frontAngle(0.0f).cellType(SensorDesc().autoTrigger(true).mode(DetectSolidDesc()))), ObjectDesc().id(2).pos({101.0f, 100.0f}), }, CreatureDesc().id(0)); data.addConnection(1, 2); - // Add many non-structure cells (should be ignored) + // Add many non-solid cells (should be ignored) for (int i = 0; i < 20; ++i) { data.addCreature({ObjectDesc().id(100 + i).pos({98.0f + (i % 4), 50.0f + (i / 4)})}); } @@ -1026,15 +1026,15 @@ TEST_F(SensorTests, detectStructure_ignoreDifferentCellTypes) auto actualData = _simulationFacade->getSimulationData(); auto actualSensor = actualData.getObjectRef(1); - // Should not find anything because only non-structure cells are present + // Should not find anything because only non-solid cells are present EXPECT_TRUE(approxCompare(0.0f, actualSensor.getCellRef()._signal._channels[Channels::SensorFoundResult])); } -TEST_F(SensorTests, detectStructure_ignoreFluidParticles) +TEST_F(SensorTests, detectSolid_ignoreFluidParticles) { auto data = Desc().addCreature( { - ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().frontAngle(0.0f).cellType(SensorDesc().autoTrigger(true).mode(DetectStructureDesc()))), + ObjectDesc().id(1).pos({100.0f, 100.0f}).type(CellDesc().frontAngle(0.0f).cellType(SensorDesc().autoTrigger(true).mode(DetectSolidDesc()))), ObjectDesc().id(2).pos({101.0f, 100.0f}), }, CreatureDesc().id(0)); @@ -1563,10 +1563,10 @@ TEST_F(SensorTests, detectCreature_ignoreStructureObjects) CreatureDesc().id(0)); data.addConnection(1, 2); - // Add structure cells (should be ignored) + // Add solid cells (should be ignored) for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { - data._objects.emplace_back(ObjectDesc().pos({100.0f + toFloat(i), 50.0f + toFloat(j)}).type(StructureDesc())); + data._objects.emplace_back(ObjectDesc().pos({100.0f + toFloat(i), 50.0f + toFloat(j)}).type(SolidDesc())); } } diff --git a/source/Gui/CreatorWindow.cpp b/source/Gui/CreatorWindow.cpp index bad9f372f0..42bdcbcac2 100644 --- a/source/Gui/CreatorWindow.cpp +++ b/source/Gui/CreatorWindow.cpp @@ -42,8 +42,8 @@ void CreatorWindow::initIntern() {} namespace { - std::map objectTypeToMaterial = {{ObjectType_Structure, 0}, {ObjectType_Fluid, 1}, {ObjectType_FreeCell, 2}}; - std::map materialToObjectType = {{0, ObjectType_Structure}, {1, ObjectType_Fluid}, {2, ObjectType_FreeCell}}; + std::map objectTypeToMaterial = {{ObjectType_Solid, 0}, {ObjectType_Fluid, 1}, {ObjectType_FreeCell, 2}}; + std::map materialToObjectType = {{0, ObjectType_Solid}, {1, ObjectType_Fluid}, {2, ObjectType_FreeCell}}; } void CreatorWindow::processIntern() @@ -363,8 +363,8 @@ void CreatorWindow::validateAndCorrect() ObjectTypeDesc CreatorWindow::getObjectTypeDesc() const { switch (_objectType) { - case ObjectType_Structure: - return StructureDesc().energy(_energy); + case ObjectType_Solid: + return SolidDesc().energy(_energy); case ObjectType_Fluid: return FluidDesc().energy(_energy).glow(_glow); case ObjectType_FreeCell: diff --git a/source/Gui/CreatorWindow.h b/source/Gui/CreatorWindow.h index e9c78c9e4e..a6c4dd3efe 100644 --- a/source/Gui/CreatorWindow.h +++ b/source/Gui/CreatorWindow.h @@ -65,7 +65,7 @@ class CreatorWindow : public AlienWindow float _innerRadius = 5.0f; //drawing - ObjectType _objectType = ObjectType_Structure; + ObjectType _objectType = ObjectType_Solid; Desc _drawingDescription; DescEditService::Occupancy _drawingOccupancy; RealVector2D _lastDrawPos; diff --git a/source/Gui/HelpStrings.h b/source/Gui/HelpStrings.h index 728f51435d..96f1482449 100644 --- a/source/Gui/HelpStrings.h +++ b/source/Gui/HelpStrings.h @@ -464,9 +464,9 @@ namespace Const "The following cell functions obtain their input from channel #6:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron", "The following cell functions obtain their input from channel #7:\n\n" ICON_FA_CHEVRON_RIGHT " Neuron"}; - std::string const CreatorPencilRadiusTooltip = "The radius of the pencil in number of structure objects."; + std::string const CreatorPencilRadiusTooltip = "The radius of the pencil in number of solid objects."; - std::string const CreatorDrawingTypeTooltip = "Specifies whether the drawn structure objects should form a solid body (with connections) or a fluid (without connections)."; + std::string const CreatorDrawingTypeTooltip = "Specifies whether the drawn solid objects should form a solid body (with connections) or a fluid (without connections)."; std::string const CreatorRectangleWidthTooltip = "The width of the rectangle in cells."; diff --git a/source/Gui/ImageToPatternDialog.cpp b/source/Gui/ImageToPatternDialog.cpp index 88683addd3..0eb8f627ff 100644 --- a/source/Gui/ImageToPatternDialog.cpp +++ b/source/Gui/ImageToPatternDialog.cpp @@ -98,7 +98,7 @@ void ImageToPatternDialog::show() int matchedCellColor; float matchedCellIntensity; getMatchedCellColor(ImColor(r, g, b, 255), matchedCellColor, matchedCellIntensity); - dataDesc._objects.emplace_back(ObjectDesc().id(NumberGenerator::get().createEntityId()).pos({toFloat(x) + xOffset, toFloat(y)}).color(matchedCellColor).fixed(false).type(StructureDesc())); + dataDesc._objects.emplace_back(ObjectDesc().id(NumberGenerator::get().createEntityId()).pos({toFloat(x) + xOffset, toFloat(y)}).color(matchedCellColor).fixed(false).type(SolidDesc())); } } } diff --git a/source/Gui/InspectorWindow.cpp b/source/Gui/InspectorWindow.cpp index 5bc5c2e12b..c2ad12bc4a 100644 --- a/source/Gui/InspectorWindow.cpp +++ b/source/Gui/InspectorWindow.cpp @@ -118,7 +118,7 @@ void _InspectorWindow::processObject(ExtendedObjectDesc& extendedObject) processCellGenomeTab(std::get(object.getCellRef()._cellType)); } } - if (object.getObjectType() == ObjectType_Structure) { + if (object.getObjectType() == ObjectType_Solid) { processStructureTab(object); } if (object.getObjectType() == ObjectType_Fluid) { @@ -657,7 +657,7 @@ void _InspectorWindow::processSensorContent(SensorDesc& sensor) .textWidth(CellTypeTextWidth) .tooltip(Const::GenomeSensorMinDensityTooltip), detectEnergy._minDensity); - } else if (mode == SensorMode_DetectStructure) { + } else if (mode == SensorMode_DetectSolid) { // No parameters } else if (mode == SensorMode_DetectFreeCell) { auto& detectFreeCell = std::get(sensor._mode); @@ -754,7 +754,7 @@ void _InspectorWindow::processDetonatorContent(DetonatorDesc& detonator) void _InspectorWindow::processStructureTab(ObjectDesc& object) { - if (ImGui::BeginTabItem("Structure", nullptr, ImGuiTabItemFlags_None)) { + if (ImGui::BeginTabItem("Solid", nullptr, ImGuiTabItemFlags_None)) { if (ImGui::BeginChild("##", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar)) { } ImGui::EndChild(); diff --git a/source/Gui/MassOperationsDialog.cpp b/source/Gui/MassOperationsDialog.cpp index d536dd02ee..887a35e672 100644 --- a/source/Gui/MassOperationsDialog.cpp +++ b/source/Gui/MassOperationsDialog.cpp @@ -87,7 +87,7 @@ void MassOperationsDialog::processIntern() ImGui::SameLine(0, ImGui::GetStyle().FramePadding.x * 4); AlienGui::Text("Randomize lineage ids"); - AlienGui::Group(AlienGui::GroupParameters().text("Structure")); + AlienGui::Group(AlienGui::GroupParameters().text("Solid")); ImGui::Checkbox("##glow", &_randomizeGlow); ImGui::SameLine(0, ImGui::GetStyle().FramePadding.x * 4); posX = ImGui::GetCursorPos().x; diff --git a/source/Gui/NodeEditorWidget.cpp b/source/Gui/NodeEditorWidget.cpp index 469bdbb3cd..a32e2909b5 100644 --- a/source/Gui/NodeEditorWidget.cpp +++ b/source/Gui/NodeEditorWidget.cpp @@ -117,8 +117,8 @@ namespace return TelemetryGenomeDesc(); case SensorMode_DetectEnergy: return DetectEnergyGenomeDesc(); - case SensorMode_DetectStructure: - return DetectStructureGenomeDesc(); + case SensorMode_DetectSolid: + return DetectSolidGenomeDesc(); case SensorMode_DetectFreeCell: return DetectFreeCellGenomeDesc(); case SensorMode_DetectCreature: @@ -155,8 +155,8 @@ namespace ReconnectorModeGenomeDesc createReconnectorModeGenomeDesc(ReconnectorMode mode) { switch (mode) { - case ReconnectorMode_Structure: - return ReconnectStructureGenomeDesc(); + case ReconnectorMode_Solid: + return ReconnectSolidGenomeDesc(); case ReconnectorMode_FreeCell: return ReconnectFreeCellGenomeDesc(); case ReconnectorMode_Creature: @@ -324,7 +324,7 @@ void _NodeEditorWidget::processNodeAttributes() } // Mode-specific parameters - if (mode == SensorMode_DetectStructure) { + if (mode == SensorMode_DetectSolid) { // No parameters } else if (mode == SensorMode_DetectEnergy) { AlienGui::BeginIndent(); @@ -332,7 +332,7 @@ void _NodeEditorWidget::processNodeAttributes() AlienGui::InputFloat( AlienGui::InputFloatParameters().name("Min density").step(0.05f).format("%.2f").textWidth(rightColumnWidth), detectEnergy._minDensity); AlienGui::EndIndent(); - } else if (mode == SensorMode_DetectStructure) { + } else if (mode == SensorMode_DetectSolid) { // No parameters } else if (mode == SensorMode_DetectFreeCell) { AlienGui::BeginIndent(); @@ -540,7 +540,7 @@ void _NodeEditorWidget::processNodeAttributes() } // Mode-specific parameters - if (mode == ReconnectorMode_Structure) { + if (mode == ReconnectorMode_Solid) { // No parameters } else if (mode == ReconnectorMode_FreeCell) { AlienGui::BeginIndent(); diff --git a/source/Gui/RenderStep.cpp b/source/Gui/RenderStep.cpp index 7b5de6dfaf..80d5601c0f 100644 --- a/source/Gui/RenderStep.cpp +++ b/source/Gui/RenderStep.cpp @@ -436,19 +436,19 @@ void _CellTypeOverlayRenderStep::createCellTypeTextureAtlas() // Create a texture atlas containing all cell type strings and object type strings // We'll arrange them in a vertical strip, one per row // Rows 0-12: Cell types (Base, Depot, Sensor, etc.) - // Row 13: "Structure" (for ObjectType_Structure) + // Row 13: "Solid" (for ObjectType_Solid) // Row 14: "Fluid" (for ObjectType_Fluid) // Row 15: "Free Cell" (for ObjectType_FreeCell) auto font = StyleRepository::get().getDefaultFont(); float fontSize = 16.0f; // Base font size for rendering - // Build combined list of labels: cell types + object types (Structure, Fluid, Free Cell) + // Build combined list of labels: cell types + object types (Solid, Fluid, Free Cell) std::vector allLabels; for (auto const& cellTypeStr : Const::CellTypeStrings) { allLabels.push_back(cellTypeStr); } - // Add object type labels (only Structure, Fluid, and Free Cell, as Cell uses cell type names) - allLabels.push_back(Const::ObjectTypeStrings[ObjectType_Structure]); + // Add object type labels (only Solid, Fluid, and Free Cell, as Cell uses cell type names) + allLabels.push_back(Const::ObjectTypeStrings[ObjectType_Solid]); allLabels.push_back(Const::ObjectTypeStrings[ObjectType_Fluid]); allLabels.push_back(Const::ObjectTypeStrings[ObjectType_FreeCell]); diff --git a/source/PersisterInterface/SerializerService.cpp b/source/PersisterInterface/SerializerService.cpp index 8754e47110..9599acc4f2 100644 --- a/source/PersisterInterface/SerializerService.cpp +++ b/source/PersisterInterface/SerializerService.cpp @@ -359,12 +359,12 @@ namespace cereal SPLIT_SERIALIZATION(DetectEnergyGenomeDesc) template - void loadSave(SerializationTask task, Archive& ar, DetectStructureGenomeDesc& data) + void loadSave(SerializationTask task, Archive& ar, DetectSolidGenomeDesc& data) { auto auxiliaries = getLoadSaveMap(task, ar); processLoadSaveMap(task, ar, auxiliaries); } - SPLIT_SERIALIZATION(DetectStructureGenomeDesc) + SPLIT_SERIALIZATION(DetectSolidGenomeDesc) template void loadSave(SerializationTask task, Archive& ar, DetectFreeCellGenomeDesc& data) @@ -572,13 +572,13 @@ namespace cereal SPLIT_SERIALIZATION(DefenderGenomeDesc) template - void loadSave(SerializationTask task, Archive& ar, ReconnectStructureGenomeDesc& data) + void loadSave(SerializationTask task, Archive& ar, ReconnectSolidGenomeDesc& data) { - ReconnectStructureGenomeDesc defaultObject; + ReconnectSolidGenomeDesc defaultObject; auto auxiliaries = getLoadSaveMap(task, ar); processLoadSaveMap(task, ar, auxiliaries); } - SPLIT_SERIALIZATION(ReconnectStructureGenomeDesc) + SPLIT_SERIALIZATION(ReconnectSolidGenomeDesc) template void loadSave(SerializationTask task, Archive& ar, ReconnectFreeCellGenomeDesc& data) @@ -1100,12 +1100,12 @@ namespace cereal SPLIT_SERIALIZATION(DetectEnergyDesc) template - void loadSave(SerializationTask task, Archive& ar, DetectStructureDesc& data) + void loadSave(SerializationTask task, Archive& ar, DetectSolidDesc& data) { auto auxiliaries = getLoadSaveMap(task, ar); processLoadSaveMap(task, ar, auxiliaries); } - SPLIT_SERIALIZATION(DetectStructureDesc) + SPLIT_SERIALIZATION(DetectSolidDesc) template void loadSave(SerializationTask task, Archive& ar, DetectFreeCellDesc& data) @@ -1334,13 +1334,13 @@ namespace cereal SPLIT_SERIALIZATION(DefenderDesc) template - void loadSave(SerializationTask task, Archive& ar, ReconnectStructureDesc& data) + void loadSave(SerializationTask task, Archive& ar, ReconnectSolidDesc& data) { - ReconnectStructureDesc defaultObject; + ReconnectSolidDesc defaultObject; auto auxiliaries = getLoadSaveMap(task, ar); processLoadSaveMap(task, ar, auxiliaries); } - SPLIT_SERIALIZATION(ReconnectStructureDesc) + SPLIT_SERIALIZATION(ReconnectSolidDesc) template void loadSave(SerializationTask task, Archive& ar, ReconnectFreeCellDesc& data) @@ -1507,14 +1507,14 @@ namespace cereal SPLIT_SERIALIZATION(VoidDesc) template - void loadSave(SerializationTask task, Archive& ar, StructureDesc& data) + void loadSave(SerializationTask task, Archive& ar, SolidDesc& data) { - StructureDesc defaultObject; + SolidDesc defaultObject; auto auxiliaries = getLoadSaveMap(task, ar); loadSave(task, auxiliaries, Id_Structure_Energy, data._energy, defaultObject._energy); processLoadSaveMap(task, ar, auxiliaries); } - SPLIT_SERIALIZATION(StructureDesc) + SPLIT_SERIALIZATION(SolidDesc) template void loadSave(SerializationTask task, Archive& ar, FluidDesc& data) diff --git a/source/Shaders/CellTypeOverlayGS.h b/source/Shaders/CellTypeOverlayGS.h index 33cd2ee643..1e46ba588e 100644 --- a/source/Shaders/CellTypeOverlayGS.h +++ b/source/Shaders/CellTypeOverlayGS.h @@ -24,7 +24,7 @@ uniform float zoom; uniform float radius; // Object type constants (matching ObjectType_ enum) -const int ObjectType_Structure = 0; +const int ObjectType_Solid = 0; const int ObjectType_Fluid = 1; const int ObjectType_FreeCell = 2; const int ObjectType_Cell = 3; @@ -39,13 +39,13 @@ void main() // Determine texture row based on object type: // - ObjectType_Cell: use cell type (rows 0-12) - // - ObjectType_Structure: row 13 ("Structure") + // - ObjectType_Solid: row 13 ("Solid") // - ObjectType_Fluid: row 14 ("Fluid") // - ObjectType_FreeCell: row 15 ("Free Cell") int textureRow; if (objectType == ObjectType_Cell) { textureRow = cellType; - } else if (objectType == ObjectType_Structure) { + } else if (objectType == ObjectType_Solid) { textureRow = CellType_Count; // Row 13 } else if (objectType == ObjectType_Fluid) { textureRow = CellType_Count + 1; // Row 14 From 10736cf47c3ac556cb964bcab739fa2899af73ed Mon Sep 17 00:00:00 2001 From: Christian Heinemann Date: Tue, 24 Mar 2026 21:23:52 +0100 Subject: [PATCH 3/3] Remove obsolete comments --- source/EngineGpuKernels/Entities.cuh | 2 +- source/EngineGpuKernels/TOs.cuh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/EngineGpuKernels/Entities.cuh b/source/EngineGpuKernels/Entities.cuh index 9d23eb76bb..c896d87119 100644 --- a/source/EngineGpuKernels/Entities.cuh +++ b/source/EngineGpuKernels/Entities.cuh @@ -506,7 +506,7 @@ struct Cell uint16_t geneIndex; // Cell type data - NeuralNet* neuralNetwork; // Not used for solid and base cells + NeuralNet* neuralNetwork; CellType cellType; CellTypeData cellTypeData; bool constructorAvailable; // If true, constructor holds valid data diff --git a/source/EngineGpuKernels/TOs.cuh b/source/EngineGpuKernels/TOs.cuh index ce422a5211..9fa40ade08 100644 --- a/source/EngineGpuKernels/TOs.cuh +++ b/source/EngineGpuKernels/TOs.cuh @@ -432,7 +432,7 @@ struct CellTO uint16_t geneIndex; // Cell type data - uint64_t neuralNetworkDataIndex; // May be invalid (not used for solid and base cells) + uint64_t neuralNetworkDataIndex; CellType cellType; CellTypeDataTO cellTypeData; bool constructorAvailable; // If true, constructor holds valid data