1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
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. *
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. *
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 ***************************************************************************/
23 #include "SavableTypes.h"
25 #include "OLCEditor.h"
26 #include "CommandInfoObject.h"
27 #include "CommandTable.h"
29 class EditorDetail
: public OLCEditor
32 typedef CommandInfoObject
<EditorDetail
> DetailCommand
; /**< The type of a CommandInfoObject for this Editor. */
34 EditorDetail(UBSocket
* sock
);
35 EditorDetail(UBSocket
* sock
, mud::DetailPtr detail
);
36 EditorDetail(UBSocket
* sock
, mud::AreaPtr parentArea
);
37 EditorDetail(UBSocket
* sock
, mud::RoomPtr parentRoom
);
38 EditorDetail(UBSocket
* sock
, mud::ChunkPtr parentChunk
);
43 std::string
name() { return "Detail"; };
44 std::string
prompt() { return "Detail> "; };
46 std::string
lookup(const std::string
& action
);
47 void dispatch(const std::string
& action
, const std::string
& argument
);
49 SavablePtr
getEditing();
50 TableImplPtr
getTable();
52 std::vector
<std::string
> getList();
53 std::vector
<std::string
> getCommands();
54 void setEditing(KeysPtr keys
);
56 void editKey(const std::string
& argument
);
57 void editDescription(const std::string
& argument
);
58 void showDetail(const std::string
& argument
);
59 void saveDetail(const std::string
& argument
);
60 void clearParents(const std::string
& argument
);
61 void setParent(const std::string
& argument
);
70 CommandTable
<EditorDetail
> m_commands
;
71 mud::DetailPtr m_detail
;
72 mud::AreaPtr m_parentArea
;
73 mud::RoomPtr m_parentRoom
;
74 mud::ChunkPtr m_parentChunk
;
77 EditorDetail::E_TARGET m_target
;
79 EditorDetail(const EditorDetail
& rhs
);
80 EditorDetail
operator=(const EditorDetail
& rhs
);