New lua versions
[ryzomcore.git] / ryzom / server / src / ai_service / ai_control_npc.h
blobcac88a679dffe4239082aa2a61ced35998db5e85
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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_CONTROL_NPC_H
18 #define RYAI_CONTROL_NPC_H
20 #include "profile.h"
22 class CBotPlayer;
23 class CSpawnBotNpc;
25 //////////////////////////////////////////////////////////////////////////////
26 // CPlayerControlNpc //
27 //////////////////////////////////////////////////////////////////////////////
29 class CPlayerControlNpc : public NLMISC::CRefCount
31 public:
32 /// ctor
33 /// \param player : the player which controls the bot
34 /// \param bot : the npc which is controlled by the player
35 CPlayerControlNpc(CBotPlayer* player, CSpawnBotNpc* bot);
36 ~CPlayerControlNpc();
38 /// check if the object is valid
39 /// WARNING: you cannot call any other method if this returns false
40 bool isValid() const;
42 /// update the control on the npc
43 void updateControl(uint ticks);
44 CSpawnBotNpc* getSpawnBot() const;
46 private:
47 /// the player controlling the bot
48 NLMISC::CRefPtr<CBotPlayer> _Player;
49 CSpawnBotNpc* _Bot;
50 CProfilePtr _ControlProfileManager;
51 uint32 _LastPathUpdate;
52 NLMISC::CEntityId _CPlayerEntityId;
53 NLMISC::CEntityId _CNpcEntityId;
57 #endif