| 17 | } |
| 18 | |
| 19 | CellFunction CellDescription::getCellFunctionType() const |
| 20 | { |
| 21 | if (!cellFunction) { |
| 22 | return CellFunction_None; |
| 23 | } |
| 24 | if (std::holds_alternative<NeuronDescription>(*cellFunction)) { |
| 25 | return CellFunction_Neuron; |
| 26 | } |
| 27 | if (std::holds_alternative<TransmitterDescription>(*cellFunction)) { |
| 28 | return CellFunction_Transmitter; |
| 29 | } |
| 30 | if (std::holds_alternative<ConstructorDescription>(*cellFunction)) { |
| 31 | return CellFunction_Constructor; |
| 32 | } |
| 33 | if (std::holds_alternative<SensorDescription>(*cellFunction)) { |
| 34 | return CellFunction_Sensor; |
| 35 | } |
| 36 | if (std::holds_alternative<NerveDescription>(*cellFunction)) { |
| 37 | return CellFunction_Nerve; |
| 38 | } |
| 39 | if (std::holds_alternative<AttackerDescription>(*cellFunction)) { |
| 40 | return CellFunction_Attacker; |
| 41 | } |
| 42 | if (std::holds_alternative<InjectorDescription>(*cellFunction)) { |
| 43 | return CellFunction_Injector; |
| 44 | } |
| 45 | if (std::holds_alternative<MuscleDescription>(*cellFunction)) { |
| 46 | return CellFunction_Muscle; |
| 47 | } |
| 48 | if (std::holds_alternative<DefenderDescription>(*cellFunction)) { |
| 49 | return CellFunction_Defender; |
| 50 | } |
| 51 | if (std::holds_alternative<ReconnectorDescription>(*cellFunction)) { |
| 52 | return CellFunction_Reconnector; |
| 53 | } |
| 54 | if (std::holds_alternative<DetonatorDescription>(*cellFunction)) { |
| 55 | return CellFunction_Detonator; |
| 56 | } |
| 57 | return CellFunction_None; |
| 58 | } |
| 59 | |
| 60 | bool CellDescription::hasGenome() const |
| 61 | { |
no outgoing calls