- Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).

- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
This commit is contained in:
Xawotihs
2011-11-13 22:36:34 +00:00
parent 2240c14f56
commit f68c106e7e
33 changed files with 320 additions and 141 deletions

View File

@@ -353,7 +353,7 @@ void GameStateMenu::setLang(int id)
void GameStateMenu::loadLangMenu()
{
LOG("GameStateMenu::loadLangMenu");
subMenuController = NEW SimpleMenu(MENU_LANGUAGE_SELECTION, this, Fonts::MENU_FONT, 150, 60);
subMenuController = NEW SimpleMenu(JGE::GetInstance(), MENU_LANGUAGE_SELECTION, this, Fonts::MENU_FONT, 150, 60);
if (!subMenuController)
return;
@@ -418,7 +418,7 @@ void GameStateMenu::ensureMGuiController()
{
if (!mGuiController)
{
mGuiController = NEW JGuiController(100, this);
mGuiController = NEW JGuiController(JGE::GetInstance(), 100, this);
if (mGuiController)
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
@@ -617,7 +617,7 @@ void GameStateMenu::Update(float dt)
if (!hasChosenGameType)
{
currentState = MENU_STATE_MAJOR_SUBMENU;
subMenuController = NEW SimpleMenu(MENU_FIRST_DUEL_SUBMENU, this, Fonts::MENU_FONT, 150, 60);
subMenuController = NEW SimpleMenu(JGE::GetInstance(), MENU_FIRST_DUEL_SUBMENU, this, Fonts::MENU_FONT, 150, 60);
if (subMenuController)
{
for (size_t i = 0; i < Rules::RulesList.size(); ++i)
@@ -791,7 +791,7 @@ void GameStateMenu::ButtonPressed(int controllerId, int controlId)
switch (controlId)
{
case MENUITEM_PLAY:
subMenuController = NEW SimpleMenu(MENU_FIRST_DUEL_SUBMENU, this, Fonts::MENU_FONT, 150, 60);
subMenuController = NEW SimpleMenu(JGE::GetInstance(), MENU_FIRST_DUEL_SUBMENU, this, Fonts::MENU_FONT, 150, 60);
if (subMenuController)
{
subMenuController->Add(SUBMENUITEM_1PLAYER, "1 Player");