src/Core/Editors/EditorRoom.h

00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Sverre Rabbelier                                *
00003  *   sverre@rabbelier.nl                                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 3 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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         void goNorth(const std::string& argument);
00055         void goNorthEast(const std::string& argument);
00056         void goEast(const std::string& argument);
00057         void goSouthEast(const std::string& argument);
00058         void goSouth(const std::string& argument);
00059         void goSouthWest(const std::string& argument);
00060         void goWest(const std::string& argument);
00061         void goNorthWest(const std::string& argument);
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 };

Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo