Rev | Line | |
---|
[2825] | 1 | #ifndef __Environment_H__
|
---|
| 2 | #define __Environment_H__
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | #include <string>
|
---|
| 6 | #include <iostream>
|
---|
| 7 | #include <fstream>
|
---|
[2828] | 8 | #include <map>
|
---|
[2825] | 9 |
|
---|
| 10 | #include "common.h"
|
---|
| 11 | #include "Vector3.h"
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | namespace CHCDemoEngine
|
---|
| 15 | {
|
---|
| 16 |
|
---|
| 17 | /** Loads startup environment for the demo
|
---|
| 18 | */
|
---|
| 19 | class Environment
|
---|
| 20 | {
|
---|
| 21 | public:
|
---|
| 22 |
|
---|
| 23 | /** Reads the environment
|
---|
| 24 | */
|
---|
| 25 | bool Read(const std::string &filename);
|
---|
| 26 |
|
---|
[2828] | 27 | bool GetFloatParam(std::string &str, float &val) const;
|
---|
| 28 | bool GetIntParam(std::string &str, int &val) const;
|
---|
| 29 | bool GetVectorParam(std::string &str, Vector3 &val) const;
|
---|
| 30 | bool GetBoolParam(std::string &str, bool &val) const;
|
---|
[2826] | 31 |
|
---|
[2828] | 32 | protected:
|
---|
[2825] | 33 |
|
---|
[2828] | 34 | /** Parse this string, return tokens separated by given delimiters
|
---|
| 35 | */
|
---|
| 36 | void Tokenize(const std::string& str, std::vector<std::string> &tokens, const std::string &delim = " ") const;
|
---|
[2825] | 37 |
|
---|
[2828] | 38 | std::map<std::string, std::string> mParams;
|
---|
[2825] | 39 | };
|
---|
| 40 |
|
---|
| 41 | }
|
---|
| 42 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.