Definition at line 16 of file ModelFactory.h.
Static Public Member Functions | |
| static Cube * | createModel (const std::string &kind, const V2 &loc, const std::string &shape) |
| Add model at scene. | |
| static Unit * | createUnit (const std::string &kind) |
| Create unit for driveable fish. | |
| static Cube * | createBorder () |
| Create special model, which will be used for outher space. | |
|
|
Create special model, which will be used for outher space. NOTE: hack border around field Definition at line 138 of file ModelFactory.cpp. 00139 {
00140 Cube *border = new Cube(V2(-1,-1), Cube::FIXED, Cube::NONE, false,
00141 new Shape("X\n"));
00142 return border;
00143 }
|
|
||||||||||||||||
|
Add model at scene.
Definition at line 29 of file ModelFactory.cpp. 00031 {
00032 if (StringTool::startsWith(kind, "output_")) {
00033 return createOutputItem(kind, loc, shape);
00034 }
00035
00036 Cube::eWeight weight;
00037 Cube::eWeight power;
00038 bool alive;
00039 createParams(kind, &weight, &power, &alive);
00040
00041 Shape *newShape = new Shape(shape);
00042 Cube *model = new Cube(loc,
00043 weight, power, alive, newShape);
00044
00045 return model;
00046 }
|
|
|
Create unit for driveable fish.
Definition at line 101 of file ModelFactory.cpp. 00102 {
00103 Unit *result = NULL;
00104 if ("fish_small" == kind) {
00105 KeyControl smallfish;
00106 smallfish.setUp(SDLK_i);
00107 smallfish.setDown(SDLK_k);
00108 smallfish.setLeft(SDLK_j);
00109 smallfish.setRight(SDLK_l);
00110 result = new Unit(smallfish, ControlSym('u', 'd', 'l', 'r'), true);
00111 }
00112 else if ("fish_big" == kind) {
00113 KeyControl bigfish;
00114 bigfish.setUp(SDLK_w);
00115 bigfish.setDown(SDLK_s);
00116 bigfish.setLeft(SDLK_a);
00117 bigfish.setRight(SDLK_d);
00118 result = new Unit(bigfish, ControlSym('U', 'D', 'L', 'R'));
00119 }
00120 else if (StringTool::startsWith(kind, "fish_extra") ||
00121 StringTool::startsWith(kind, "fish_EXTRA"))
00122 {
00123 KeyControl extrafish;
00124 extrafish.setUp(SDLK_LAST);
00125 extrafish.setDown(SDLK_LAST);
00126 extrafish.setLeft(SDLK_LAST);
00127 extrafish.setRight(SDLK_LAST);
00128 result = new Unit(extrafish, parseExtraControlSym(kind));
00129 }
00130 return result;
00131 }
|
1.4.2