![]() |
Player.hGo to the documentation of this file.00001 // Player.h 00002 // released 2006-09-25 00003 /* 00004 Copyright (C) 2006 Anders Hedstrom (grymse@alhem.net) 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 #ifndef _PLAYER_H 00021 #define _PLAYER_H 00022 00023 #include <string> 00024 #include <map> 00025 #include "Object.h" 00026 00027 00028 namespace db { class Account; } 00029 class Database; 00030 class Area; 00031 class Chunk; 00032 00033 typedef std::map<std::string,db::Account *> accounts_t; 00034 00037 class Player : public Object 00038 { 00039 public: 00040 Player(Database&, const std::string& name); 00041 ~Player(); 00042 00043 std::string GetName(); 00044 bool IsWizard(); 00045 std::string GetPasswd(); 00046 std::string GetDisplayName(); 00047 void SetName(const std::string&); 00048 void SetPasswd(const std::string& ); 00049 void SetWizard(bool); 00050 void SetDisplayName(const std::string&); 00051 void SetEmail(const std::string&); 00052 long GetArea(); 00053 long GetChunk(); 00054 long GetChunkX(); 00055 long GetChunkY(); 00056 void SetChunkX(int); 00057 void SetChunkY(int); 00058 void SetArea(long); 00059 void SetChunk(long); 00060 long GetNum(); 00062 int GetFacing(); 00064 void SetFacing(int); 00065 void SetRace(long); 00066 long GetRace(); 00067 00068 void VerifyPos(); 00069 00070 void Save(); 00071 bool Exists(); 00072 00073 static db::Account *GetAccount(Database& db,const std::string& name); 00074 00075 void SetWizView(bool = true); 00076 bool IsWizView(); 00077 00078 long GetCoordX(Area&,Chunk&); 00079 long GetCoordY(Area&,Chunk&); 00080 bool Seen(Area&,long xcoord,long ycoord,int ch_z); 00081 double SightRange(); 00082 void LoadSteps(); 00083 00084 private: 00085 db::Account *m_account; 00086 static accounts_t m_accounts; 00087 }; 00088 00089 00090 00091 00092 #endif // _PLAYER_H |