Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

multiplayer.h

00001 
00002 /***************************************************************************
00003                           multiplayer.h  -  description
00004                              -------------------
00005     begin                : Tue Aug 12 2003
00006     copyright            : (C) 2003 by Gabor Torok
00007     email                : cctorok@yahoo.com
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef MULTIPLAYER_H
00020 #define MULTIPLAYER_H
00021 
00022 #include "constants.h"
00023 #include "scourge.h"
00024 #include "gui/window.h"
00025 #include "gui/label.h"
00026 #include "gui/button.h"
00027 #include "gui/textfield.h"
00028 #include "party.h"
00029 
00034 class Scourge;
00035 class Party;
00036 
00037 class MultiplayerDialog {
00038 private:
00039   Scourge *scourge;
00040   Window *mainWin;
00041   Button *startServer;
00042   Button *joinServer;
00043   Button *okButton;
00044   TextField *serverName;
00045   TextField *serverPort;
00046   TextField *userName;
00047   ScrollingList *characterList;
00048   int value;
00049   char **charStr;
00050   Creature *pc[MAX_PARTY_SIZE];
00051   int pcCount;
00052   
00053 public:
00054 
00055   static const int START_SERVER = 1;
00056   static const int JOIN_SERVER = 2;
00057 
00058   MultiplayerDialog(Scourge *scourge);
00059   ~MultiplayerDialog();
00060 
00061   inline void show() { value = 0; mainWin->setVisible(true); }
00062   inline void hide() { mainWin->setVisible(false); }
00063   inline bool isVisible() { return mainWin->isVisible(); }
00064 
00065   inline char *getServerName() { return serverName->getText(); }
00066   inline char *getServerPort() { return serverPort->getText(); }
00067   inline char *getUserName() { return userName->getText(); }
00068   inline int getValue() { return value; }
00069   Creature *getCreature();
00070 
00071   bool handleEvent(SDL_Event *event);
00072   bool handleEvent(Widget *widget, SDL_Event *event);
00073 };
00074 
00075 #endif

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0