Formatting cleanup. No code changes here.
This commit is contained in:
@@ -24,10 +24,12 @@ class Player;
|
|||||||
class GameApp;
|
class GameApp;
|
||||||
|
|
||||||
|
|
||||||
class Options {
|
class Options
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
friend class GameSettings;
|
friend class GameSettings;
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
//Global settings
|
//Global settings
|
||||||
ACTIVE_PROFILE,
|
ACTIVE_PROFILE,
|
||||||
LANG,
|
LANG,
|
||||||
@@ -84,7 +86,6 @@ public:
|
|||||||
AWARD_COLLECTOR,
|
AWARD_COLLECTOR,
|
||||||
LAST_NAMED, //Any option after this does not look up in optionNames.
|
LAST_NAMED, //Any option after this does not look up in optionNames.
|
||||||
SET_UNLOCKS = LAST_NAMED + 1, //For sets.
|
SET_UNLOCKS = LAST_NAMED + 1, //For sets.
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int optionSet(int setID);
|
static int optionSet(int setID);
|
||||||
@@ -97,9 +98,13 @@ private:
|
|||||||
static const string optionNames[];
|
static const string optionNames[];
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameOption {
|
class GameOption
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~GameOption() {};
|
virtual ~GameOption()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int number;
|
int number;
|
||||||
string str;
|
string str;
|
||||||
//All calls to asColor should include a fallback color for people without a theme.
|
//All calls to asColor should include a fallback color for people without a theme.
|
||||||
@@ -115,14 +120,16 @@ public:
|
|||||||
GameOption(int, string);
|
GameOption(int, string);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EnumDefinition {
|
struct EnumDefinition
|
||||||
|
{
|
||||||
int findIndex(int value);
|
int findIndex(int value);
|
||||||
|
|
||||||
typedef pair<int, string> assoc;
|
typedef pair<int, string> assoc;
|
||||||
vector<assoc> values;
|
vector<assoc> values;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameOptionEnum: public GameOption {
|
class GameOptionEnum : public GameOption
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
virtual string menuStr();
|
virtual string menuStr();
|
||||||
virtual bool write(std::ofstream * file, string name);
|
virtual bool write(std::ofstream * file, string name);
|
||||||
@@ -130,7 +137,8 @@ public:
|
|||||||
EnumDefinition * def;
|
EnumDefinition * def;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameOptionAward: public GameOption {
|
class GameOptionAward : public GameOption
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
GameOptionAward();
|
GameOptionAward();
|
||||||
virtual string menuStr();
|
virtual string menuStr();
|
||||||
@@ -138,91 +146,185 @@ public:
|
|||||||
virtual bool read(string input);
|
virtual bool read(string input);
|
||||||
virtual bool giveAward(); //Returns false if already awarded
|
virtual bool giveAward(); //Returns false if already awarded
|
||||||
virtual bool isViewed();
|
virtual bool isViewed();
|
||||||
virtual void setViewed(bool v = true) {viewed = v;};
|
|
||||||
|
virtual void setViewed(bool v = true)
|
||||||
|
{
|
||||||
|
viewed = v;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
time_t achieved; //When was it awarded?
|
time_t achieved; //When was it awarded?
|
||||||
bool viewed; //Flag it as "New!" or not.
|
bool viewed; //Flag it as "New!" or not.
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameOptionKeyBindings : public GameOption {
|
class GameOptionKeyBindings : public GameOption
|
||||||
|
{
|
||||||
virtual bool read(string input);
|
virtual bool read(string input);
|
||||||
virtual bool write(std::ofstream*, string);
|
virtual bool write(std::ofstream*, string);
|
||||||
};
|
};
|
||||||
|
|
||||||
class OptionVolume: public EnumDefinition{
|
class OptionVolume : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { MUTE = 0, MAX = 100 };
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
MUTE = 0,
|
||||||
|
MAX = 100
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionVolume();
|
OptionVolume();
|
||||||
static OptionVolume mDef;
|
static OptionVolume mDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class OptionClosedHand: public EnumDefinition {
|
class OptionClosedHand : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { INVISIBLE = 0, VISIBLE = 1 };
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
INVISIBLE = 0,
|
||||||
|
VISIBLE = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition* getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionClosedHand();
|
OptionClosedHand();
|
||||||
static OptionClosedHand mDef;
|
static OptionClosedHand mDef;
|
||||||
};
|
};
|
||||||
class OptionHandDirection: public EnumDefinition {
|
|
||||||
|
class OptionHandDirection : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { VERTICAL = 0, HORIZONTAL = 1};
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
VERTICAL = 0,
|
||||||
|
HORIZONTAL = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionHandDirection();
|
OptionHandDirection();
|
||||||
static OptionHandDirection mDef;
|
static OptionHandDirection mDef;
|
||||||
};
|
};
|
||||||
class OptionManaDisplay: public EnumDefinition {
|
|
||||||
|
class OptionManaDisplay : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { DYNAMIC = 0, STATIC = 1, NOSTARSDYNAMIC = 2, BOTH = 3};
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
DYNAMIC = 0,
|
||||||
|
STATIC = 1,
|
||||||
|
NOSTARSDYNAMIC = 2,
|
||||||
|
BOTH = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionManaDisplay();
|
OptionManaDisplay();
|
||||||
static OptionManaDisplay mDef;
|
static OptionManaDisplay mDef;
|
||||||
};
|
};
|
||||||
class OptionMaxGrade: public EnumDefinition {
|
|
||||||
|
class OptionMaxGrade : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionMaxGrade();
|
OptionMaxGrade();
|
||||||
static OptionMaxGrade mDef;
|
static OptionMaxGrade mDef;
|
||||||
};
|
};
|
||||||
class OptionASkipPhase: public EnumDefinition {
|
|
||||||
|
class OptionASkipPhase : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionASkipPhase();
|
OptionASkipPhase();
|
||||||
static OptionASkipPhase mDef;
|
static OptionASkipPhase mDef;
|
||||||
};
|
};
|
||||||
class OptionWhosFirst: public EnumDefinition {
|
|
||||||
|
class OptionWhosFirst : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { WHO_P = 0, WHO_O = 1, WHO_R = 2};
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
WHO_P = 0,
|
||||||
|
WHO_O = 1,
|
||||||
|
WHO_R = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionWhosFirst();
|
OptionWhosFirst();
|
||||||
static OptionWhosFirst mDef;
|
static OptionWhosFirst mDef;
|
||||||
};
|
};
|
||||||
class OptionEconDifficulty: public EnumDefinition {
|
|
||||||
|
class OptionEconDifficulty : public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
static EnumDefinition * getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionEconDifficulty();
|
OptionEconDifficulty();
|
||||||
static OptionEconDifficulty mDef;
|
static OptionEconDifficulty mDef;
|
||||||
};
|
};
|
||||||
class OptionDifficulty: public EnumDefinition {
|
|
||||||
|
class OptionDifficulty: public EnumDefinition
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum { NORMAL = 0, HARD = 1, HARDER = 2, EVIL = 3};
|
enum
|
||||||
static EnumDefinition * getInstance() {return &mDef;};
|
{
|
||||||
|
NORMAL = 0,
|
||||||
|
HARD = 1,
|
||||||
|
HARDER = 2,
|
||||||
|
EVIL = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
static EnumDefinition* getInstance()
|
||||||
|
{
|
||||||
|
return &mDef;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionDifficulty();
|
OptionDifficulty();
|
||||||
static OptionDifficulty mDef;
|
static OptionDifficulty mDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameOptions {
|
class GameOptions
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
string mFilename;
|
string mFilename;
|
||||||
int save();
|
int save();
|
||||||
int load();
|
int load();
|
||||||
@@ -232,14 +334,16 @@ class GameOptions {
|
|||||||
GameOptions(string filename);
|
GameOptions(string filename);
|
||||||
~GameOptions();
|
~GameOptions();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<GameOption*> values;
|
vector<GameOption*> values;
|
||||||
vector<string> unknown;
|
vector<string> unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GameSettings{
|
class GameSettings
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
friend class GameApp;
|
friend class GameApp;
|
||||||
|
|
||||||
GameSettings();
|
GameSettings();
|
||||||
~GameSettings();
|
~GameSettings();
|
||||||
int save();
|
int save();
|
||||||
@@ -248,9 +352,26 @@ public:
|
|||||||
string keypadFinish();
|
string keypadFinish();
|
||||||
void keypadShutdown();
|
void keypadShutdown();
|
||||||
void keypadTitle(string set);
|
void keypadTitle(string set);
|
||||||
bool keypadActive() {if(keypad) return keypad->isActive(); return false;};
|
|
||||||
void keypadUpdate(float dt) {if(keypad) keypad->Update(dt);};
|
bool keypadActive()
|
||||||
void keypadRender() {if(keypad) keypad->Render();};
|
{
|
||||||
|
if(keypad)
|
||||||
|
return keypad->isActive();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void keypadUpdate(float dt)
|
||||||
|
{
|
||||||
|
if(keypad)
|
||||||
|
keypad->Update(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void keypadRender()
|
||||||
|
{
|
||||||
|
if(keypad)
|
||||||
|
keypad->Render();
|
||||||
|
}
|
||||||
|
|
||||||
bool newAward();
|
bool newAward();
|
||||||
|
|
||||||
@@ -263,7 +384,7 @@ public:
|
|||||||
void checkProfile(); //Confirms that a profile is loaded and contains a collection.
|
void checkProfile(); //Confirms that a profile is loaded and contains a collection.
|
||||||
void createUsersFirstDeck(int setId);
|
void createUsersFirstDeck(int setId);
|
||||||
|
|
||||||
GameOption * get(int);
|
GameOption* get(int);
|
||||||
GameOption& operator[](int);
|
GameOption& operator[](int);
|
||||||
|
|
||||||
GameOptions* profileOptions;
|
GameOptions* profileOptions;
|
||||||
@@ -273,12 +394,12 @@ public:
|
|||||||
|
|
||||||
WStyle * getStyle();
|
WStyle * getStyle();
|
||||||
StyleManager * getStyleMan();
|
StyleManager * getStyleMan();
|
||||||
void automaticStyle(Player * p1, Player * p2);
|
void automaticStyle(Player* p1, Player* p2);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GameApp * theGame;
|
GameApp* theGame;
|
||||||
SimplePad * keypad;
|
SimplePad* keypad;
|
||||||
StyleManager * styleMan;
|
StyleManager* styleMan;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GameSettings options;
|
extern GameSettings options;
|
||||||
|
|||||||
Reference in New Issue
Block a user