EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
Loading...
Searching...
No Matches
EnigmaMachineConfig.cpp
Go to the documentation of this file.
1
7
8#include <numeric>
9
10RotorConfig::RotorConfig() { std::iota(wiring.begin(), wiring.end(), 0); }
11
13 for (int i = 0; i < TRANSFORMER_SIZE; ++i) {
14 wiring[i] = TRANSFORMER_SIZE - 1 - i;
15 }
16}
17
19 for (auto& pair : plugBoardPairs) {
20 pair.sourcePortIndex = -1;
21 pair.destinationPortIndex = -1;
22 }
23}
constexpr int TRANSFORMER_SIZE
Size of the alphabet/transformer (Standard Enigma is 26).
Definition config.hpp:10
EnigmaMachineConfig()
Default constructor. Initializes plugboard pairs to -1 (unused).
std::array< PlugBoardPair, PLUGBOARD_MAX_PAIRS > plugBoardPairs
Plugboard connection pairs.
std::array< AlphabetIndex, TRANSFORMER_SIZE > wiring
The internal wiring permutation array (reflection map). Must be of size TRANSFORMER_SIZE.
std::array< AlphabetIndex, TRANSFORMER_SIZE > wiring
The internal wiring permutation array (forward direction). Must be of size TRANSFORMER_SIZE.