29 lines
489 B
C++
29 lines
489 B
C++
|
#include "Session.h"
|
||
|
#include "EngineFactory.h"
|
||
|
#include "IGame.h"
|
||
|
#include "Game.h"
|
||
|
#include "GuiWrapper.h"
|
||
|
|
||
|
Session::Session ( GuiWrapper * g)
|
||
|
: gui_(g)
|
||
|
{
|
||
|
newGame();
|
||
|
gui_->init(this);
|
||
|
gui_->start();
|
||
|
}
|
||
|
|
||
|
void Session::newGame ()
|
||
|
{
|
||
|
// todo: do this completely different
|
||
|
// delete game_;
|
||
|
Game * g = new Game( factory.createKalah(), 12);
|
||
|
g->player1("P1", true);
|
||
|
g->player2("P2", true);
|
||
|
game_ = g;
|
||
|
}
|
||
|
|
||
|
IGame * Session::game () const
|
||
|
{
|
||
|
return game_;
|
||
|
}
|