-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathParser.h
49 lines (47 loc) · 1.13 KB
/
Parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef PARSER_H_
#define PARSER_H_
#include <fstream>
#include <list>
#include <iostream>
#include <cstdlib>
#include <map>
#include "Location.h"
#include "Item.h"
#include "Player.h"
using namespace std;
class Parser {
int stripComments(); // Comment striping code
int ParseDefaults();
int ParseLocations();
int ParsePlayer();
int ParseItems();
void ParseLocation(string data, Location* location);
void ParseItem(string data, Item* item);
string file_data;
Location* inventory;
public:
Parser(char* filename);
list<string> ParseFile(); // Returns the errors
string gameName;
string gameCredits;
string initialDescription;
string defaultResponse;
string defaultInventoryName;
string defaultInteractiveName;
string defaultNoObjects;
string restoreGameChoice;
string restoreGameMessage;
string newGameChoice;
string saveGame;
string saveGameMessage;
string gameSavedMessage;
Location *initialLocation;
list<string> errors;
map<string, Location*> locations;
map<string, Item*> items;
map<string, string> default_verb_expressions;
map<string, string> default_location_verb_expressions;
Player* player;
~Parser(void);
};
#endif