Added count functionality in SavableManager.
[UnsignedByte.git] / src / Core / EditorRoom.h
blobdfd5ad01f3155b305b6d6e2d23e1ef998fdfd81b
1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 #include "Types.h"
23 #include "SavableTypes.h"
25 #include "OLCEditor.h"
26 #include "CommandObject.h"
27 #include "CommandTable.h"
29 class EditorRoom : public OLCEditor
31 public:
32 typedef CommandObject<EditorRoom> RoomCommand; /**< The type of a CommandObject for this Editor. */
34 EditorRoom(UBSocket* sock);
35 EditorRoom(UBSocket* sock, mud::AreaPtr parentRoom);
36 ~EditorRoom(void);
38 void OnFocus();
40 std::string name() { return "Room"; };
41 std::string prompt() { return "Room> "; };
43 std::string lookup(const std::string& action);
44 void dispatch(const std::string& action, const std::string& argument);
46 SavablePtr getEditing();
47 TableImplPtr getTable();
48 KeysPtr addNew();
49 std::vector<std::string> getList();
50 std::vector<std::string> getCommands();
51 void setEditing(KeysPtr keys);
54 void goNorth(const std::string& argument);
55 void goNorthEast(const std::string& argument);
56 void goEast(const std::string& argument);
57 void goSouthEast(const std::string& argument);
58 void goSouth(const std::string& argument);
59 void goSouthWest(const std::string& argument);
60 void goWest(const std::string& argument);
61 void goNorthWest(const std::string& argument);
64 void listAreas(const std::string& argument);
65 void showMap(const std::string& argument);
67 void editName(const std::string& argument);
68 void editDescription(const std::string& argument);
69 void editSector(const std::string& argument);
70 void editArea(const std::string& argument);
71 void clearParentArea(const std::string& argument);
72 void setParentArea(const std::string& argument);
74 void closeExit(const std::string& argument);
75 void openExit(const std::string& argument);
77 void showRoom(const std::string& argument);
78 void saveRoom(const std::string& argument);
79 void startDetails(const std::string& argument);
80 void startChunks(const std::string& argument);
82 private:
83 EditorRoom(const EditorRoom& rhs);
84 EditorRoom operator=(const EditorRoom& rhs);
86 private:
87 CommandTable<EditorRoom> m_commands;
88 CommandTable<EditorRoom> m_editing_commands;
90 enum E_TARGET
92 M_NONE,
93 M_DESCRIPTION,
96 mud::RoomPtr m_room;
97 std::string m_value;
98 EditorRoom::E_TARGET m_target;
99 mud::AreaPtr m_parentArea;