src/Core/Editors/EditorCluster.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 
00024 #include "OLCEditor.h"
00025 #include "CommandInfoObject.h"
00026 #include "CommandTable.h"
00027 
00028 class EditorCluster : public OLCEditor
00029 {
00030 public:
00031         typedef CommandInfoObject<EditorCluster> ClusterCommand; 
00033         EditorCluster(UBSocket* sock);
00034         EditorCluster(UBSocket* sock, mud::AreaPtr parentArea);
00035         ~EditorCluster(void);
00036         
00037         void OnFocus();
00038 
00039         std::string name() { return "Cluster"; };
00040         std::string prompt() { return "Cluster> "; };
00041         
00042         std::string lookup(const std::string& action);
00043         void dispatch(const std::string& action, const std::string& argument);
00044         
00045         SavablePtr getEditing();
00046         TableImplPtr getTable();
00047         KeysPtr addNew();
00048         std::vector<std::string> getList();
00049         std::vector<std::string> getCommands();
00050         void setEditing(KeysPtr keys);
00051         
00052         void editName(const std::string& argument);     
00053         void editDescription(const std::string& argument);
00054         void editArea(const std::string& argument);
00055         void startRooms(const std::string& argument);
00056         void showCluster(const std::string& argument);
00057         void saveCluster(const std::string& argument);
00058         void clearParentArea(const std::string& argument);
00059         void setParentArea(const std::string& argument);        
00060 
00061 private:
00062         enum E_TARGET
00063         {
00064                 M_NONE,
00065                 M_DESCRIPTION,
00066         };
00067 
00068         CommandTable<EditorCluster> m_commands;
00069         mud::ClusterPtr m_cluster;
00070         mud::AreaPtr m_parentArea;
00071         EditorCluster::E_TARGET m_target;
00072         std::string m_value;
00073 
00074         EditorCluster(const EditorCluster& rhs);
00075         EditorCluster operator=(const EditorCluster& rhs);
00076 };

Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo