diff options
author | Paul Gilbert | 2016-05-28 21:42:18 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:16:43 -0400 |
commit | 421812f27c59e53e68dfbaa777284c74a8fb7938 (patch) | |
tree | 0ca956f0212727260a7edb41272f1bbaa1bcf704 /engines/titanic/core | |
parent | a7ecc6d601f1beabd0f5538d5e1cd7d6e983d2b9 (diff) | |
download | scummvm-rg350-421812f27c59e53e68dfbaa777284c74a8fb7938.tar.gz scummvm-rg350-421812f27c59e53e68dfbaa777284c74a8fb7938.tar.bz2 scummvm-rg350-421812f27c59e53e68dfbaa777284c74a8fb7938.zip |
TITANIC: More implementing deskbot message handlers
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/tree_item.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/core/tree_item.h | 10 |
2 files changed, 25 insertions, 3 deletions
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp index 8dd3da054d..86a6b174a8 100644 --- a/engines/titanic/core/tree_item.cpp +++ b/engines/titanic/core/tree_item.cpp @@ -319,9 +319,23 @@ int CTreeItem::getPassengerClass() const { return gameManager ? gameManager->_gameState._passengerClass : 3; } -int CTreeItem::getStateC() const { +int CTreeItem::getPriorClass() const { CGameManager *gameManager = getGameManager(); - return gameManager ? gameManager->_gameState._fieldC : 3; + return gameManager ? gameManager->_gameState._priorClass : 3; +} + +void CTreeItem::setPassengerClass(int newClass) { + if (newClass >= 1 && newClass <= 4) { + // Change the passenger class + CGameManager *gameMan = getGameManager(); + gameMan->_gameState._priorClass = gameMan->_gameState._passengerClass; + gameMan->_gameState._passengerClass = newClass; + + // Setup the PET again, so the new class's PET background can take effect + CPetControl *petControl = getPetControl(); + if (petControl) + petControl->setup(); + } } } // End of namespace Titanic diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h index 1dcaee552d..d893d6d9ce 100644 --- a/engines/titanic/core/tree_item.h +++ b/engines/titanic/core/tree_item.h @@ -284,7 +284,15 @@ public: */ int getPassengerClass() const; - int getStateC() const; + /** + * Return the player's previous passenger class + */ + int getPriorClass() const; + + /** + * Set's the player's passenger class + */ + void setPassengerClass(int newClass); }; } // End of namespace Titanic |