Google
Web alhem.net
Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ConnectThread.h

Go to the documentation of this file.
00001 00006 /* 00007 Copyright (C) 2004 Anders Hedstrom 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 */ 00023 #ifndef _CONNECTTHREAD_H 00024 #define _CONNECTTHREAD_H 00025 00026 00027 using iotm::IOMessage; 00028 00029 00030 00031 00032 class EventThread; 00033 class Player; 00034 class Map; 00035 00036 00037 typedef std::map<long,Player *> players_t; 00038 typedef std::map<long,Map *> maps_t; 00039 00040 00041 class ConnectThread : public iotm::IOThread 00042 { 00043 public: 00044 ConnectThread(); 00045 ConnectThread(char *host, int port = DEFAULT_PORT); 00046 ~ConnectThread(); 00047 void Run(); 00048 00049 unsigned long get_ip(char *); 00050 IOMessage *GetClass(IO_IDTYPE); 00051 00052 // cache stuff 00053 Player *AddPlayer(long); 00054 Player *AddPlayer(long,const string &); 00055 Player *GetPlayer(long); 00056 // 00057 void SetSelf(long num,const string &); 00058 Player *GetSelf(void); 00059 // 00060 Map *AddMap(long x,long y,Event::Map * = NULL); 00061 Map *GetMap(long x,long y); 00062 // end of cache stuff 00063 00064 private: 00065 short m_connected; 00066 char m_host[256]; 00067 int m_port; 00068 unsigned long m_ip; 00069 EventThread *m_pclEventThread; 00070 #pragma warning("this is where we should cache map, players, overlays, etc") 00071 Player *m_self; 00072 players_t m_players; 00073 maps_t m_maps; 00074 }; 00075 00076 #endif // _CONNECTTHREAD_H

Generated for SDL C++ GUI by doxygen 1.3.6