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/>.
22 #include "continent.h"
24 //////////////////////////////////////////////////////////////////////////////
26 //////////////////////////////////////////////////////////////////////////////
32 virtual ~CDynGrpBase();
34 void initDynGrp(IGroupDesc
const* const gd
, CFamilyBehavior
const* const familyBehavior
);
36 void setDiscardable(bool discardable
) const;
37 bool getDiscardable() const;
39 NLMISC::CSmartPtr
<IGroupDesc
const> const& getGroupDesc() const;
41 NLMISC::CDbgPtr
<CFamilyBehavior
> const& getFamilyBehavior() const;
43 float getEnergyCoef() const;
45 bool getCountMultiplierFlag() const;
48 /** Flag for group discardability.
49 * If this flag is set, then the group can be despawn when
50 * the family spawned energy is to high.
51 * When cleared, the group cannot be despawned automaticaly
52 * either for enegy reason nor for unadequate energy level.
54 mutable bool _Discardable
;
55 /// The dynamic group model
56 NLMISC::CSmartPtr
<IGroupDesc
const> _GroupDesc
;
58 /// The family this group belong to
59 NLMISC::CDbgPtr
<CFamilyBehavior
> _FamilyBehavior
;
62 //////////////////////////////////////////////////////////////////////////////
64 //////////////////////////////////////////////////////////////////////////////
69 CDynBot() : _BotEnergyValue(0)
73 /// The energy value of this bot.
75 const uint32
&botEnergyValue () const
77 return _BotEnergyValue
;
80 void setBotEnergyValue (const uint32
&energyValue
)
82 _BotEnergyValue
=energyValue
;
85 virtual void addEnergy() const = 0;
86 virtual void removeEnergy() const = 0;
89 uint32 _BotEnergyValue
;
95 CDynSpawnBot(const CDynBot
&dynBot
) : _DynBot(dynBot
)
100 virtual ~CDynSpawnBot()
102 _DynBot
.removeEnergy();
106 const CDynBot
&_DynBot
;