| 180 | } |
| 181 | |
| 182 | Command::Result cList(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager& mm) |
| 183 | { |
| 184 | ODFrameListener* frameListener = ODFrameListener::getSingletonPtr(); |
| 185 | GameMap* gameMap = frameListener->getClientGameMap(); |
| 186 | |
| 187 | if (args.size() < 2) |
| 188 | { |
| 189 | c.print("lists available:\n\t\tclasses\tcreatures\tplayers\n\t\tnetwork\trooms\tcolors\n\t\tgoals\n"); |
| 190 | return Command::Result::SUCCESS; |
| 191 | } |
| 192 | |
| 193 | std::stringstream stringStr; |
| 194 | |
| 195 | if (args[1].compare("creatures") == 0) |
| 196 | { |
| 197 | stringStr << "Class:\tCreature name:\tLocation:\tColor:\tLHand:\tRHand\n\n"; |
| 198 | for (Creature* creature : gameMap->getCreatures()) |
| 199 | { |
| 200 | GameEntity::exportToStream(creature, stringStr); |
| 201 | stringStr << std::endl; |
| 202 | } |
| 203 | } |
| 204 | else if (args[1].compare("classes") == 0) |
| 205 | { |
| 206 | stringStr << "Class:\tMesh:\tHP:\tMana:\tSightRadius:\tDigRate:\tMovespeed:\n\n"; |
| 207 | for (unsigned int i = 0; i < gameMap->numClassDescriptions(); ++i) |
| 208 | { |
| 209 | const CreatureDefinition* currentClassDesc = gameMap->getClassDescription(i); |
| 210 | stringStr << currentClassDesc << "\n"; |
| 211 | } |
| 212 | } |
| 213 | else if (args[1].compare("players") == 0) |
| 214 | { |
| 215 | stringStr << "Local player:\tNick:\tSeatId\tTeamId:\n\n" |
| 216 | << "me\t\t" << gameMap->getLocalPlayer()->getNick() << "\t" |
| 217 | << gameMap->getLocalPlayer()->getSeat()->getId() << "\t" |
| 218 | << gameMap->getLocalPlayer()->getSeat()->getTeamId() << "\n\n"; |
| 219 | |
| 220 | stringStr << "Player:\tNick:\tSeatId\tTeamId:\n\n"; |
| 221 | |
| 222 | for (Player* player : gameMap->getPlayers()) |
| 223 | { |
| 224 | stringStr << player->getId() << "\t\t" << player->getNick() << "\t" |
| 225 | << player->getSeat()->getId() << "\t" |
| 226 | << player->getSeat()->getTeamId() << "\n\n"; |
| 227 | } |
| 228 | } |
| 229 | else if (args[1].compare("network") == 0) |
| 230 | { |
| 231 | if (mm.getCurrentModeType() == AbstractModeManager::EDITOR) |
| 232 | { |
| 233 | stringStr << "You are currently in the map editor."; |
| 234 | } |
| 235 | else if (ODServer::getSingleton().isConnected()) |
| 236 | { |
| 237 | stringStr << "You are currently acting as a server."; |
| 238 | } |
| 239 | else |
nothing calls this directly
no test coverage detected