- Modified undo to stop at "next phase" action - Added "muligan" and "force library shuffling" to the list of logged action - Fixed random logging - Fixed double logging of actions - Merged all the "next game" functions into a single one - Created a PlayerType type instead of using int - Moved the player loading code into the GameObserver and out of GameStateDuel to avoid having player references in both and simplify the initialization and termination. Tweeked a bit the humanplayer class to be able to do that. - Added a "load" menu available in testsuite mode, I use that to load problematique game. To use it, just copy-paste a game from the traces into Res/test/game/timetwister.txt. Game in traces starts by "rvalues:..." and ends by "[end]" - Added some untested and commented out code in GuiCombat to use the mouse/touch to setup the damage on the blockers - Broke the network game ... hoh well, I'll repair it when everything else works !! - various code cleanup and compilation fixes on Linux
94 lines
2.1 KiB
C++
94 lines
2.1 KiB
C++
#ifndef _GAME_STATE_DUEL_H_
|
|
#define _GAME_STATE_DUEL_H_
|
|
|
|
#include "GameState.h"
|
|
#include "SimpleMenu.h"
|
|
#include "SimplePopup.h"
|
|
#include "DeckMenu.h"
|
|
#include "MTGDeck.h"
|
|
#include "GameObserver.h"
|
|
|
|
#define CHOOSE_OPPONENT 7
|
|
|
|
#ifdef TESTSUITE
|
|
class TestSuite;
|
|
#endif
|
|
class Credits;
|
|
#ifdef NETWORK_SUPPORT
|
|
class JNetwork;
|
|
#endif
|
|
|
|
class GameStateDuel: public GameState, public JGuiListener
|
|
{
|
|
private:
|
|
#ifdef TESTSUITE
|
|
TestSuite * testSuite;
|
|
#endif
|
|
|
|
Credits * credits;
|
|
int mGamePhase;
|
|
Player * mCurrentPlayer;
|
|
GameObserver * game;
|
|
DeckMenu * deckmenu;
|
|
DeckMenu * opponentMenu;
|
|
SimpleMenu * menu;
|
|
SimplePopup * popupScreen; // used for informational screens, modal
|
|
static int selectedPlayerDeckId;
|
|
static int selectedAIDeckId;
|
|
|
|
bool premadeDeck;
|
|
int OpponentsDeckid;
|
|
string musictrack;
|
|
|
|
bool MusicExist(string FileName);
|
|
void ConstructOpponentMenu(); //loads the opponentMenu if it doesn't exist
|
|
void initScroller();
|
|
void setGamePhase(int newGamePhase);
|
|
|
|
public:
|
|
GameStateDuel(GameApp* parent);
|
|
virtual ~GameStateDuel();
|
|
#ifdef TESTSUITE
|
|
void loadTestSuitePlayers();
|
|
#endif
|
|
|
|
#ifdef AI_CHANGE_TESTING
|
|
int totalTestGames;
|
|
int testPlayer2Victories;
|
|
int totalAIDecks;
|
|
#endif
|
|
|
|
virtual void ButtonPressed(int ControllerId, int ControlId);
|
|
virtual void Start();
|
|
virtual void End();
|
|
virtual void Update(float dt);
|
|
virtual void Render();
|
|
void initRand(unsigned seed = 0);
|
|
|
|
void OnScroll(int inXVelocity, int inYVelocity);
|
|
|
|
enum ENUM_DUEL_STATE_MENU_ITEM
|
|
{
|
|
MENUITEM_CANCEL = kCancelMenuID,
|
|
MENUITEM_NEW_DECK = -10,
|
|
MENUITEM_RANDOM_PLAYER = kRandomPlayerMenuID,
|
|
MENUITEM_RANDOM_AI = kRandomAIPlayerMenuID,
|
|
MENUITEM_MAIN_MENU = -13,
|
|
MENUITEM_EVIL_TWIN = kEvilTwinMenuID,
|
|
MENUITEM_MULLIGAN = -15,
|
|
MENUITEM_UNDO = -16,
|
|
#ifdef TESTSUITE
|
|
MENUITEM_LOAD = -17,
|
|
#endif
|
|
#ifdef NETWORK_SUPPORT
|
|
MENUITEM_REMOTE_CLIENT = -18,
|
|
MENUITEM_REMOTE_SERVER = -19,
|
|
#endif
|
|
MENUITEM_MORE_INFO = kInfoMenuID
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
|