aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-11-22 21:57:02 +0100
committerStrangerke2013-11-22 21:57:02 +0100
commitdc8dc450fb7844ec3be2a45e6061981ea526fd4a (patch)
tree55a572a28ca6ffe3df5a0d66ad5f909377d28bac /engines/avalanche
parent95ee8cb9f51a2632e67ebcf3be5b663837badb97 (diff)
downloadscummvm-rg350-dc8dc450fb7844ec3be2a45e6061981ea526fd4a.tar.gz
scummvm-rg350-dc8dc450fb7844ec3be2a45e6061981ea526fd4a.tar.bz2
scummvm-rg350-dc8dc450fb7844ec3be2a45e6061981ea526fd4a.zip
AVALANCHE: Janitorial - Align some comments in Parser
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/parser.cpp28
-rw-r--r--engines/avalanche/parser.h36
2 files changed, 45 insertions, 19 deletions
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 852a063a7e..d5f57919b5 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -522,10 +522,17 @@ void Parser::cursorOff() {
_cursorState = false;
}
+/**
+ * Asks the parsekey proc in Dropdown if it knows it.
+ */
void Parser::tryDropdown() {
- warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown's keyboard handling.
+ // TODO: Implement at the same time with Dropdown's keyboard handling.
+ warning("STUB: Parser::tryDropdown()");
}
+/**
+ * Returns the index of the first appearance of crit in src.
+ */
int16 Parser::getPos(const Common::String &crit, const Common::String &src) {
if (src.contains(crit))
return strstr(src.c_str(),crit.c_str()) - src.c_str();
@@ -625,6 +632,9 @@ void Parser::cheatParse(Common::String codes) {
warning("STUB: Parser::cheatParse()");
}
+/**
+ * Strips punctuation from word.
+ */
void Parser::stripPunctuation(Common::String &word) {
const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
@@ -945,6 +955,9 @@ void Parser::parse() {
}
}
+/**
+ * Examine a standard object-thing
+ */
void Parser::examineObject() {
if (_thing != _vm->_thinks)
_vm->thinkAbout(_thing, AvalancheEngine::kThing);
@@ -1175,6 +1188,9 @@ void Parser::swallow() {
}
}
+/**
+ * this lists the other people in the room.
+ */
void Parser::peopleInRoom() {
// First compute the number of people in the room.
byte numPeople = 0;
@@ -1212,6 +1228,9 @@ void Parser::peopleInRoom() {
_vm->_dialogs->displayText(tmpStr + " here.");
}
+/**
+ * This is called when you say "look".
+ */
void Parser::lookAround() {
_vm->_dialogs->displayText(*_vm->_also[0][1]);
switch (_vm->_room) {
@@ -1316,6 +1335,9 @@ void Parser::openDoor() {
_vm->_dialogs->displayText("Door? What door?");
}
+/**
+ * Called when you call kVerbCodeput.
+ */
void Parser::putProc() {
if (!isHolding())
return;
@@ -1422,6 +1444,7 @@ void Parser::goToCauldron() {
/**
* Check is it's possible to give something to Spludwick
+ * The result of this function is whether or not he says "Hey, thanks!".
* @remarks Originally called 'give2spludwick'
*/
bool Parser::giveToSpludwick() {
@@ -1501,6 +1524,9 @@ void Parser::already() {
_vm->_dialogs->displayText("You're already standing!");
}
+/**
+ * Called when you ask Avvy to stand.
+ */
void Parser::standUp() {
switch (_vm->_room) {
case kRoomYours:
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index dfbe2dccb1..fe46170e65 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -39,11 +39,11 @@ class AvalancheEngine;
class Parser {
public:
- static const byte kPardon = 254; // Didn't understand / wasn't given.
static const int16 kParserWordsNum = 277; // How many words does the parser know?
+ static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+ static const byte kPardon = 254; // Didn't understand / wasn't given.
static const byte kNothing = 250;
- static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
- static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+ static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
struct VocabEntry {
byte _number;
@@ -62,9 +62,9 @@ public:
byte _thing;
People _person;
bool _polite;
- Common::String _inputText; // Original name: current
+ Common::String _inputText;
Common::String _inputTextBackup;
- byte _inputTextPos; // Original name: curpos
+ byte _inputTextPos;
bool _quote;
bool _cursorState;
bool _weirdWord;
@@ -86,8 +86,8 @@ public:
void plotText();
void cursorOn();
void cursorOff();
- void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
- int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+ void tryDropdown();
+ int16 getPos(const Common::String &crit, const Common::String &src);
void doVerb(VerbCode id);
void resetVariables();
@@ -106,10 +106,10 @@ private:
Common::String _thats;
byte _thing2;
- byte _sworeNum; // number of times you've sworn
+ byte _sworeNum; // number of times you've sworn
byte _alcoholLevel; // Your blood alcohol level.
- byte _playedNim; // How many times you've played Nim.
- bool _boughtOnion; // Have you bought an onion yet?
+ byte _playedNim; // How many times you've played Nim.
+ bool _boughtOnion; // Have you bought an onion yet?
byte wordNum(Common::String word);
void replace(Common::String oldChars, byte newChar);
@@ -119,14 +119,14 @@ private:
void clearWords();
void cheatParse(Common::String codes);
- void stripPunctuation(Common::String &word); // Strips punctuation from word.
- void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
+ void stripPunctuation(Common::String &word);
+ void displayWhat(byte target, bool animate, bool &ambiguous);
bool doPronouns();
void properNouns();
- void lookAround(); // This is called when you say "look".
+ void lookAround();
void openDoor();
void storeInterrogation(byte interrogation);
- void examineObject(); // Examine a standard object-thing
+ void examineObject();
bool isPersonHere();
void exampers();
bool isHolding();
@@ -134,14 +134,14 @@ private:
void examine();
void inventory();
void swallow();
- void peopleInRoom(); // This lists the other people in the room.
- void putProc(); // Called when you call kVerbCodeput.
+ void peopleInRoom();
+ void putProc();
void notInOrder();
void goToCauldron();
- bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
+ bool giveToSpludwick();
void cardiffClimbing();
void already();
- void standUp(); // Called when you ask Avvy to stand.
+ void standUp();
void getProc(char thing);
void giveGeidaTheLute();
void playHarp();