/// <summary> /// The entire round trip encoing process for the given letter /// </summary> public char ConvertCharacter(char c) { char next = _plugboard.ConvertLetter(c); char next2 = _rotor3.ConvertLetter(next); int rotor2index = _rotor3.GetNextRotorsIndex(next2); char next3 = _rotor2.ConvertLetter(rotor2index); int rotor1index = _rotor2.GetNextRotorsIndex(next3); char next4 = _rotor1.ConvertLetter(rotor1index); int reflectorIndex = _rotor1.GetNextRotorsIndex(next4); char next5 = _reflector.ReflectLetter(reflectorIndex); int nextRotor1Index = _reflector.GetNextRotorsIndex(next5); char initLetter1 = _rotor1.ReverseConvertLetter(nextRotor1Index); int nextRotor2Index = _rotor1.ReverseGetNextRotorsIndex(initLetter1); char initLetter2 = _rotor2.ReverseConvertLetter(nextRotor2Index); int nextRotor3Index = _rotor2.ReverseGetNextRotorsIndex(initLetter2); char initLetter3 = _rotor3.ReverseConvertLetter(nextRotor3Index); int plugBoardIndex = _rotor3.ReverseGetNextRotorsIndex(initLetter3); char lightBoardChar = _plugboard.ConvertLetter(plugBoardIndex); return(lightBoardChar); }