#include <logic/Logic.hpp>

#ifdef _MSC_VER
#include <windows.h>
#endif

int myMain(
  int argc,
  char* argv[]
) {
  try {
    Logic* logic = Logic::create();
    logic->loop();
    delete logic;
  } catch (const std::runtime_error& e) {
    std::cerr << e.what() << std::endl;
  }
  return 0;
}

int main(
  int argc,
  char* argv[]
) {
  return myMain(
    argc,
    argv
  );
}

#ifdef _MSC_VER
  int WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdline,
    int nCmdShow
  ) {
    return myMain(
      0,
      NULL
    );
  }
#endif
