1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Benjamin Grauer |
---|
13 | co-programmer: ... |
---|
14 | */ |
---|
15 | |
---|
16 | #include "load_param_class_description.h" |
---|
17 | |
---|
18 | #include "multi_type.h" |
---|
19 | #include "debug.h" |
---|
20 | |
---|
21 | /** |
---|
22 | * A list, that holds all the classes that are loadable (classes not objects!!) |
---|
23 | */ |
---|
24 | LoadParamClassDescription::ClassDescriptionSet LoadParamClassDescription::_classList; |
---|
25 | |
---|
26 | /** |
---|
27 | * if the description of Parameters should be executed |
---|
28 | */ |
---|
29 | bool LoadParamClassDescription::_parametersDescription = false; |
---|
30 | |
---|
31 | /** |
---|
32 | * @param className the name of the class to be loadable |
---|
33 | */ |
---|
34 | LoadParamClassDescription::LoadParamClassDescription(const std::string& className) |
---|
35 | : _className(className) |
---|
36 | { } |
---|
37 | |
---|
38 | /** |
---|
39 | * deletes a classDescription (deletes all the parameterDescriptions as well |
---|
40 | */ |
---|
41 | LoadParamClassDescription::~LoadParamClassDescription() |
---|
42 | {} |
---|
43 | |
---|
44 | void LoadParamClassDescription::deleteAllDescriptions() |
---|
45 | { |
---|
46 | LoadParamClassDescription::_classList.clear(); |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | /** |
---|
51 | * prints out all loadable Classes, and their parameters |
---|
52 | * @param fileName prints the output to a File |
---|
53 | * @todo implement it |
---|
54 | */ |
---|
55 | void LoadParamClassDescription::printAll(const std::string& fileName) |
---|
56 | { |
---|
57 | PRINT(3)("===============================================================\n"); |
---|
58 | PRINT(3)(" Listing all the Loadable Options (loaded since Game started).\n\n"); |
---|
59 | for (ClassDescriptionSet::const_iterator classIt = LoadParamClassDescription::_classList.begin(); |
---|
60 | classIt != LoadParamClassDescription::_classList.begin(); |
---|
61 | classIt ++) |
---|
62 | { |
---|
63 | PRINT(3)("<%s>\n", (*classIt)._className.c_str()); |
---|
64 | for (ParamDescriptionSet::const_iterator param = (*classIt)._parameters.begin(); |
---|
65 | param != (*classIt)._parameters.end(); |
---|
66 | ++param) |
---|
67 | { |
---|
68 | (*param).print(); |
---|
69 | } |
---|
70 | PRINT(3)("</%s>\n\n", (*classIt)._className.c_str()); |
---|
71 | } |
---|
72 | PRINT(3)("===============================================================\n"); |
---|
73 | } |
---|