aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs_create_char.h
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-18 19:02:10 -0500
committerPaul Gilbert2018-02-18 19:02:10 -0500
commit0b36518839f4933985ae56015be95a900c4e1e82 (patch)
tree172ce342240211877e883d356102c11b4ccceadd /engines/xeen/dialogs_create_char.h
parentfa1f426ee64621f4b668d73def2eb77508629696 (diff)
downloadscummvm-rg350-0b36518839f4933985ae56015be95a900c4e1e82.tar.gz
scummvm-rg350-0b36518839f4933985ae56015be95a900c4e1e82.tar.bz2
scummvm-rg350-0b36518839f4933985ae56015be95a900c4e1e82.zip
XEEN: Cleanup and fixes for exchanging character attributes
Diffstat (limited to 'engines/xeen/dialogs_create_char.h')
-rw-r--r--engines/xeen/dialogs_create_char.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/engines/xeen/dialogs_create_char.h b/engines/xeen/dialogs_create_char.h
index b3232271e6..de140e8626 100644
--- a/engines/xeen/dialogs_create_char.h
+++ b/engines/xeen/dialogs_create_char.h
@@ -36,6 +36,8 @@ private:
int _diceFrame[3];
Common::Point _dicePos[3];
Common::Point _diceInc[3];
+ uint _attribs[TOTAL_ATTRIBUTES];
+ bool _allowedClasses[TOTAL_CLASSES];
private:
/**
* Constructor
@@ -68,6 +70,18 @@ private:
void execute();
/**
+ * Returns the attribute that a given keycode represents
+ */
+ int getAttribFromKeycode(int keycode) const;
+
+ /**
+ * Handles the logic for swapping attributes
+ * @param keycode Key pressed representing one of the attributes
+ * @returns True if swap occurred
+ */
+ bool swapAttributes(int keycode);
+
+ /**
* Exchanging two attributes for the character being rolled
*/
int exchangeAttribute(int srcAttr);
@@ -76,14 +90,12 @@ private:
* Set a list of flags for which classes the passed attribute set meet the
* minimum requirements of
*/
- void checkClass(const uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]);
+ void checkClass();
/**
* Return details of the generated character
*/
- int newCharDetails(const uint attribs[TOTAL_ATTRIBUTES],
- bool allowedClasses[TOTAL_CLASSES], Race race, Sex sex, int classId,
- int selectedClass, Common::String &msg);
+ int newCharDetails(Race race, Sex sex, int classId, int selectedClass, Common::String &msg);
/**
* Print the selection arrow to indicate the selected class
@@ -93,14 +105,13 @@ private:
/**
* Saves the rolled character into the roster
*/
- bool saveCharacter(Character &c, int classId, Race race,
- Sex sex, uint attribs[TOTAL_ATTRIBUTES]);
+ bool saveCharacter(Character &c, int classId, Race race, Sex sex);
/**
* Roll up some random values for the attributes, and return both them as
* well as a list of classes that the attributes meet the requirements for
*/
- void throwDice(uint attribs[TOTAL_ATTRIBUTES], bool allowedClasses[TOTAL_CLASSES]);
+ void rollAttributes();
public:
/**
* Shows the Create Character dialog