#include <iostream>
#include <cstdlib>
#include <memory>
#include <string>
#include <stdio.h>
#include <time.h>
#include "map.h"
#include "races.h"
#include "display.h"
#include "rng.h"

using namespace std;

RNG rng;//{(unsigned int)time(0)};

int main() {
        display display;
        unique_ptr<game_map> mmap(new game_map{default_map, 0});
        unique_ptr<class shade>
                player(new shade{mmap->get_available_positions()});

        for (char ch = ' '; ch != 'q'; ch = getchar()) {
                display.clear();
                mmap->print(display);
                display.print_position(player->get_position(), '@');

                auto available_positions = mmap->get_available_positions();

                switch (ch) {
                case 'j':
                        player->move(direction::south, available_positions);
                        break;

                case 'k':
                        player->move(direction::north, available_positions);
                        break;

                case 'h':
                        player->move(direction::west, available_positions);
                        break;

                case 'l':
                        player->move(direction::east, available_positions);
                        break;
                }
        }
}
