Planeshift
|
00001 /* 00002 * questionclient.h - Author: Ondrej Hurt 00003 * 00004 * Copyright (C) 2001 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 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 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 */ 00019 00020 #ifndef __QUESTION_CLIENT_H__ 00021 #define __QUESTION_CLIENT_H__ 00022 00023 #include <csutil/hash.h> 00024 #include "net/cmdbase.h" 00025 00026 class MsgHandler; 00027 struct iObjectRegistry; 00028 class pawsYesNoBox; 00029 00031 class psQuestion 00032 { 00033 public: 00034 psQuestion(uint32_t questionID) { this->questionID = questionID; } 00035 virtual ~psQuestion() {}; 00036 00039 virtual void Cancel() = 0; 00040 protected: 00041 uint32_t questionID; 00042 }; 00043 00044 00049 class psQuestionClient : public psClientNetSubscriber 00050 { 00051 public: 00052 psQuestionClient(MsgHandler* mh, iObjectRegistry* obj); 00053 virtual ~psQuestionClient(); 00054 00055 // iNetSubscriber interface 00056 virtual void HandleMessage(MsgEntry *msg); 00057 00059 void DeleteQuestion(uint32_t questionID); 00060 00062 void SendResponseToQuestion(uint32_t questionID, const csString & answer); 00063 00064 protected: 00065 00073 void HandleConfirm(uint32_t questionID, const csString &question); 00083 void HandleDuel(uint32_t questionID, const csString &question); 00090 void HandleSecretGuildNotify(uint32_t questionID, const csString &question); 00098 void HandleMarriage(uint32_t questionID, const csString &question); 00099 00100 MsgHandler* messageHandler; 00101 00102 csHash<psQuestion*> questions; 00103 }; 00104 00105 #endif 00106