]> jfr.im git - irc/gameservirc.git/blame - gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/IPlayerDAO.h
Fixed data/monsters.dat
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / include / GameServ / DataLayer / IPlayerDAO.h
CommitLineData
ce4e8c42 1#ifndef __GS__IPlayerDAO_H__\r
2#define __GS__IPlayerDAO_H__\r
3\r
4#include <GameServ/GameLayer/GameObjects/PlayerGO.h>\r
5using GameServ::GameLayer::GameObjects::PlayerGO;\r
6\r
cce88913 7#include <boost/smart_ptr/shared_ptr.hpp>\r
ce4e8c42 8using boost::shared_ptr;\r
9\r
ce4e8c42 10#include <list>\r
11using std::list;\r
12#include <string>\r
13using std::string;\r
14\r
15namespace GameServ { namespace DataLayer { namespace DataAccessObjects\r
16{\r
17 //! Interface for Player Data Access Objects \r
18 /*! \r
19 This is the interface for all Player DAOs. Each specific datasource\r
20 will need to inherit this common interface.\r
21 */\r
22 class IPlayerDAO\r
23 {\r
24 public:\r
25 // Ctors, Dtors ///////////////////////////////////////////////////////\r
26 IPlayerDAO(void);\r
27 virtual ~IPlayerDAO(void); // Needs to be virtual \r
28\r
29 //! Get the Player using a unique data/object Id\r
30 /*!\r
31 \param Id Unique identifier\r
32 \return A boost shared pointer to a Player game object if found\r
33 otherwise the list is empty.\r
34 */\r
35 virtual shared_ptr<PlayerGO> GetById(const string &Id) const = 0;\r
36\r
37 /*! Get a list of Player Ids by Name\r
38 \param Name The partial name of the Player to match against the beginning of a Player name\r
39 \return A collection of Player Ids matching the name\r
40 */\r
41 virtual list<string> GetIdsByName(const string &Name) const = 0;\r
42\r
2a8a990d 43 //! Function to quickly search to see if an Id exists or not\r
44 /*!\r
45 \param Id The Id of the game object to search for\r
46 \return true if the Id is valid and exists in the data, false otherwise\r
47 */\r
ce4e8c42 48 virtual bool IdExists(const string &Id) const = 0;\r
49\r
50 virtual void Insert(shared_ptr<PlayerGO> spPlayer) = 0;\r
51 virtual void Update(shared_ptr<PlayerGO> spPlayer) = 0;\r
52 private:\r
53 \r
54 \r
55 };\r
56} } }\r
57#endif // __GS__IPlayerDAO_H__\r