1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef RYAI_MGR_PET_H
18 #define RYAI_MGR_PET_H
21 #include "ai_bot_pet.h"
22 #include "server_share/pet_interface_msg.h"
26 typedef std::map
<NLMISC::CEntityId
, uint32
> TEntityIdMapUint32
;
28 //////////////////////////////////////////////////////////////////////////////
30 //////////////////////////////////////////////////////////////////////////////
32 /// This is the manager class for pets, pack animals and steeds
37 CMgrPet(IManagerParent
* parent
, uint32 alias
, std::string
const& name
, std::string
const& filename
) ;
43 virtual void spawn() { CManager::spawn(); }
44 void despawnMgr() { CManager::despawnMgr(); }
46 CStateMachine
* getStateMachine() { return NULL
; }
48 void createPetGroup(NLMISC::CEntityId
const& petOwnerId
);
49 CGrpPet
* getPetGroup(NLMISC::CEntityId
const& petOwnerId
);
50 void removePetGroup(NLMISC::CEntityId
const& petOwnerId
);
52 AITYPES::TMgrType
type() const { return AITYPES::MgrTypePet
; }
54 void serviceEvent(CServiceEvent
const& info
);
56 virtual std::string
getOneLineInfoString() const { return std::string("Pet manager '") + getName() + "'"; }
59 TEntityIdMapUint32 _EntityIdToIndex
;
62 //////////////////////////////////////////////////////////////////////////////
64 //////////////////////////////////////////////////////////////////////////////
69 virtual void callback(std::string
const& name
, NLNET::TServiceId id
);
72 //////////////////////////////////////////////////////////////////////////////
74 //////////////////////////////////////////////////////////////////////////////
79 virtual void callback(std::string
const& name
, NLNET::TServiceId id
);
82 //////////////////////////////////////////////////////////////////////////////
83 // CPetCommandMsgImp //
84 //////////////////////////////////////////////////////////////////////////////
86 class CPetCommandMsgImp
87 : public CPetCommandMsg
89 virtual void callback(std::string
const& name
, NLNET::TServiceId id
);
92 /****************************************************************************/
94 /****************************************************************************/
96 //////////////////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////////////////
101 CMgrPet::CMgrPet(IManagerParent
* parent
, uint32 alias
, std::string
const& name
, std::string
const& filename
)
102 : CManager(parent
, alias
, name
, filename
)