
#pragma once

#include <iostream>
#include <string>
#include <ciso646>

class PolybiusSquare
{
public:

    enum MODE
    {
        MODE_ALPHANUM,
        MODE_RNG
    };

private:

    size_t      m_Dimension;
    char*       m_Data;
    MODE        m_Mode;

    std::string m_KeyX;
    std::string m_KeyY;

    bool        m_Verbose;
    bool        m_PRNGReshuffle;
    int         m_PRNGIndex;

    PolybiusSquare();

public:

    PolybiusSquare( enum MODE mode, size_t dimension );
   ~PolybiusSquare();

    void print();
    void setKey( std::string key );
    void setPRNGReshuffle();
    void setVerbose( bool flag=true );
    
    void transpose();
    void transposeX();
    void transposeY();

    std::string encode( char c );
    std::string encode( std::string s );
    std::string decode( std::string s );

    std::string addPRNG( std::string s );
    std::string subPRNG( std::string s );

};

