Only allow this language: ((n|s)!(w|e)!(u|d)!;)+ for directions.
[UnsignedByte.git] / src / Core / Editors / EditorRoom.h
blobd96c6986ce8bce575a22fae1511e7b1f3fa167c2
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 "CommandInfoObject.h"
27 #include "CommandTable.h"
29 class EditorRoom : public OLCEditor
31 public:
32 typedef CommandInfoObject<EditorRoom> RoomCommand; /**< The type of a CommandInfoObject for this Editor. */
34 EditorRoom(UBSocket* sock);
35 EditorRoom(UBSocket* sock, mud::ClusterPtr 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);
53 void editName(const std::string& argument);
54 void editDescription(const std::string& argument);
55 void editSector(const std::string& argument);
56 void editCluster(const std::string& argument);
57 void clearParentCluster(const std::string& argument);
58 void setParentCluster(const std::string& argument);
60 void showRoom(const std::string& argument);
61 void saveRoom(const std::string& argument);
62 void startDetails(const std::string& argument);
63 void startChunks(const std::string& argument);
64 void listClusters(const std::string& argument);
66 private:
67 EditorRoom(const EditorRoom& rhs);
68 EditorRoom operator=(const EditorRoom& rhs);
70 private:
71 CommandTable<EditorRoom> m_commands;
73 enum E_TARGET
75 M_NONE,
76 M_DESCRIPTION,
79 mud::RoomPtr m_room;
80 std::string m_value;
81 EditorRoom::E_TARGET m_target;
82 mud::ClusterPtr m_parentCluster;