Planeshift
questionclient.h
Go to the documentation of this file.
1 /*
2  * questionclient.h - Author: Ondrej Hurt
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
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.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __QUESTION_CLIENT_H__
21 #define __QUESTION_CLIENT_H__
22 
23 #include <csutil/hash.h>
24 #include "net/cmdbase.h"
25 
26 class MsgHandler;
27 struct iObjectRegistry;
28 class pawsYesNoBox;
29 
32 {
33 public:
34  psQuestion(uint32_t questionID) { this->questionID = questionID; }
35  virtual ~psQuestion() {};
36 
39  virtual void Cancel() = 0;
40 protected:
41  uint32_t questionID;
42 };
43 
44 
50 {
51 public:
52  psQuestionClient(MsgHandler* mh, iObjectRegistry* obj);
53  virtual ~psQuestionClient();
54 
55  // iNetSubscriber interface
56  virtual void HandleMessage(MsgEntry *msg);
57 
59  void DeleteQuestion(uint32_t questionID);
60 
62  void SendResponseToQuestion(uint32_t questionID, const csString & answer);
63 
64 protected:
65 
73  void HandleConfirm(uint32_t questionID, const csString &question);
83  void HandleDuel(uint32_t questionID, const csString &question);
90  void HandleSecretGuildNotify(uint32_t questionID, const csString &question);
98  void HandleMarriage(uint32_t questionID, const csString &question);
99 
101 
102  csHash<psQuestion*> questions;
103 };
104 
105 #endif
106 
MsgHandler * messageHandler
csHash< psQuestion * > questions
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
uint32_t questionID
virtual ~psQuestion()
The psQuestionClient class manages answering to various questions sent from server to user...
This is a yes/no box used to do confirms.
Definition: pawsyesnobox.h:41
psQuestion is superclass of all question types.
This class is the client&#39;s and server&#39;s main interface for either sending network messages out or get...
Definition: msghandler.h:106
psQuestion(uint32_t questionID)
virtual void Cancel()=0
Cancels answering of this question, for example closes some PAWS window Question deletes itself...