00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #pragma once
00021 
00022 #include "Types.h"
00023 #include "SavableTypes.h"
00024 
00025 #include "OLCEditor.h"
00026 #include "CommandInfoObject.h"
00027 #include "CommandTable.h"
00028 
00029 class EditorRoom : public OLCEditor
00030 {
00031 public:
00032         typedef CommandInfoObject<EditorRoom> RoomCommand; 
00034         EditorRoom(UBSocket* sock);
00035         EditorRoom(UBSocket* sock, mud::ClusterPtr parentRoom);
00036         ~EditorRoom(void);
00037         
00038         void OnFocus();
00039 
00040         std::string name() { return "Room"; };
00041         std::string prompt() { return "Room> "; };
00042         
00043         std::string lookup(const std::string& action);
00044         void dispatch(const std::string& action, const std::string& argument);
00045         
00046         SavablePtr getEditing();
00047         TableImplPtr getTable();
00048         KeysPtr addNew();
00049         std::vector<std::string> getList();
00050         std::vector<std::string> getCommands();
00051         void setEditing(KeysPtr keys);
00052         
00053         
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063         
00064         void listClusters(const std::string& argument);
00065         void showMap(const std::string& argument);
00066         
00067         void editName(const std::string& argument);
00068         void editDescription(const std::string& argument);
00069         void editSector(const std::string& argument);
00070         void editCluster(const std::string& argument);
00071         void clearParentCluster(const std::string& argument);
00072         void setParentCluster(const std::string& argument);
00073         
00074         void closeExit(const std::string& argument);
00075         void openExit(const std::string& argument);
00076         
00077         void showRoom(const std::string& argument);
00078         void saveRoom(const std::string& argument);
00079         void startDetails(const std::string& argument);
00080         void startChunks(const std::string& argument);
00081 
00082 private:
00083         EditorRoom(const EditorRoom& rhs);
00084         EditorRoom operator=(const EditorRoom& rhs);
00085 
00086 private:
00087         CommandTable<EditorRoom> m_commands;
00088         CommandTable<EditorRoom> m_editing_commands;
00089 
00090         enum E_TARGET
00091         {
00092                 M_NONE,
00093                 M_DESCRIPTION,
00094         };
00095 
00096         mud::RoomPtr m_room;
00097         std::string m_value;
00098         EditorRoom::E_TARGET m_target;
00099         mud::ClusterPtr m_parentCluster;
00100 };