1 #ifndef GAME_MWWORLD_CLASS_H
2 #define GAME_MWWORLD_CLASS_H
8 #include <boost/shared_ptr.hpp>
19 class RenderingInterface;
54 static std::map<std::string, boost::shared_ptr<Class> >
sClasses;
120 virtual void hit(
const Ptr& ptr,
float attackStrength,
int type=-1)
const;
134 virtual void block (
const Ptr& ptr)
const;
142 virtual boost::shared_ptr<Action>
activate (
const Ptr& ptr,
const Ptr& actor)
const;
145 virtual boost::shared_ptr<Action>
use (
const Ptr& ptr)
161 virtual void lock (
const Ptr& ptr,
int lockLevel)
const;
164 virtual void unlock (
const Ptr& ptr)
const;
329 static const Class&
get (
const std::string& key);
332 static void registerClass (
const std::string& key, boost::shared_ptr<Class> instance);
virtual bool canSell(const MWWorld::ConstPtr &item, int npcServices) const
Determine whether or not item can be sold to an npc with the given npcServices.
Definition: class.cpp:53
virtual std::string getDownSoundId(const ConstPtr &ptr) const
Definition: class.cpp:260
static std::map< std::string, boost::shared_ptr< Class > > sClasses
Definition: class.hpp:54
virtual MWMechanics::CreatureStats & getCreatureStats(const Ptr &ptr) const
Definition: class.cpp:63
virtual int getSkill(const MWWorld::Ptr &ptr, int skill) const
Definition: class.cpp:423
virtual bool isEssential(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:221
virtual int getItemMaxHealth(const ConstPtr &ptr) const
Definition: class.cpp:86
virtual bool isBipedal(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:374
virtual void restock(const MWWorld::Ptr &ptr) const
Definition: class.hpp:345
virtual void adjustScale(const MWWorld::ConstPtr &ptr, osg::Vec3f &scale, bool rendering) const
Definition: class.cpp:298
virtual bool canWalk(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:389
virtual bool apply(const MWWorld::Ptr &ptr, const std::string &id, const MWWorld::Ptr &actor) const
Definition: class.cpp:43
Common creature stats.
Definition: creaturestats.hpp:25
virtual bool showsInInventory(const ConstPtr &ptr) const
Definition: class.cpp:280
virtual void readAdditionalState(const MWWorld::Ptr &ptr, const ESM::ObjectState &state) const
Read additional state from state into ptr.
Definition: class.cpp:433
virtual MWMechanics::NpcStats & getNpcStats(const Ptr &ptr) const
Definition: class.cpp:68
virtual boost::shared_ptr< Action > use(const Ptr &ptr) const
Definition: class.cpp:116
virtual void unlock(const Ptr &ptr) const
Unlock object (default implementation: throw an exception)
Definition: class.cpp:141
Definition: inventorystore.hpp:40
static void registerClass(const std::string &key, boost::shared_ptr< Class > instance)
Definition: class.cpp:249
virtual bool canSwim(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:384
virtual int getItemHealth(const ConstPtr &ptr) const
Return current item health or throw an exception if class does not have item health.
Definition: class.cpp:78
virtual bool isKey(const MWWorld::ConstPtr &ptr) const
Definition: class.hpp:288
virtual void setDoorState(const MWWorld::Ptr &ptr, int state) const
This does not actually cause the door to move. Use World::activateDoor instead.
Definition: class.cpp:452
Definition: renderinginterface.hpp:9
std::string mTypeName
Definition: class.hpp:56
virtual void getModelsToPreload(const MWWorld::Ptr &ptr, std::vector< std::string > &models) const
Get a list of models to preload that this object may use (directly or indirectly). default implementation: list getModel().
Definition: class.cpp:307
bool isPureFlyingCreature(const MWWorld::Ptr &ptr) const
Definition: class.cpp:402
virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string &enchId, int enchCharge, const std::string &newName) const
Creates a new record using ptr as template, with the given name and the given enchantment applied to ...
Definition: class.cpp:314
Definition: physicssystem.hpp:51
virtual int getEquipmentSkill(const ConstPtr &ptr) const
Definition: class.cpp:196
virtual bool canLock(const ConstPtr &ptr) const
Definition: class.cpp:146
virtual std::string getName(const ConstPtr &ptr) const =0
Base class for referenceable esm records.
Definition: class.hpp:52
virtual bool isNpc() const
Definition: class.hpp:306
Class & operator=(const Class &)
virtual int getDoorState(const MWWorld::ConstPtr &ptr) const
0 = nothing, 1 = opening, 2 = closing
Definition: class.cpp:447
virtual osg::Vec3f getRotationVector(const Ptr &ptr) const
Return desired rotations, as euler angles.
Definition: class.cpp:186
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:302
virtual void hit(const Ptr &ptr, float attackStrength, int type=-1) const
Definition: class.cpp:91
virtual float getSpeed(const Ptr &ptr) const
Return movement speed.
Definition: class.cpp:166
virtual std::pair< std::vector< int >, bool > getEquipmentSlots(const ConstPtr &ptr) const
Definition: class.cpp:191
boost::shared_ptr< Action > defaultItemActivate(const Ptr &ptr, const Ptr &actor) const
Generate default action for activating inventory items.
Definition: class.cpp:328
virtual bool isClass(const MWWorld::ConstPtr &ptr, const std::string &className) const
Definition: class.cpp:442
virtual int getPrimaryFactionRank(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:480
virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const
Definition: class.cpp:106
virtual bool hasItemHealth(const ConstPtr &ptr) const
Definition: class.cpp:73
<
Definition: objectstate.hpp:19
virtual void insertObject(const Ptr &ptr, const std::string &mesh, MWPhysics::PhysicsSystem &physics) const
Add reference into a cell for rendering (default implementation: don't render anything).
Definition: class.cpp:38
Desired movement for an actor.
Definition: movement.hpp:9
virtual std::string getEnchantment(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:293
virtual float getArmorRating(const MWWorld::Ptr &ptr) const
Definition: class.cpp:226
bool isPureWaterCreature(const MWWorld::Ptr &ptr) const
Definition: class.cpp:394
virtual void lock(const Ptr &ptr, int lockLevel) const
Lock object (default implementation: throw an exception)
Definition: class.cpp:136
Mutable state of a cell.
Definition: cellstore.hpp:53
bool isMobile(const MWWorld::Ptr &ptr) const
Definition: class.cpp:418
virtual float getEncumbrance(const MWWorld::Ptr &ptr) const
Definition: class.cpp:216
virtual std::string getInventoryIcon(const MWWorld::ConstPtr &ptr) const
Return name of inventory icon.
Definition: class.cpp:270
virtual std::string getPrimaryFaction(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:476
virtual float getWeight(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:211
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
const std::string & getTypeName() const
Definition: class.hpp:75
virtual std::pair< int, std::string > canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const
Definition: class.cpp:319
virtual void respawn(const MWWorld::Ptr &ptr) const
Definition: class.hpp:343
virtual bool isActor() const
Definition: class.hpp:302
virtual int getValue(const ConstPtr &ptr) const
Definition: class.cpp:201
Definition: containerstore.hpp:41
virtual boost::shared_ptr< Action > activate(const Ptr &ptr, const Ptr &actor) const
Generate action for activation (default implementation: return a null action).
Definition: class.cpp:111
virtual bool isPersistent(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:244
virtual float getRemainingUsageTime(const ConstPtr &ptr) const
Definition: class.cpp:156
virtual ContainerStore & getContainerStore(const Ptr &ptr) const
Definition: class.cpp:121
virtual std::string getScript(const ConstPtr &ptr) const
Definition: class.cpp:161
virtual std::string getUpSoundId(const ConstPtr &ptr) const
Definition: class.cpp:255
virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:471
virtual void setRemainingUsageTime(const Ptr &ptr, float duration) const
Definition: class.cpp:151
virtual bool isGold(const MWWorld::ConstPtr &ptr) const
Definition: class.hpp:290
virtual bool hasToolTip(const ConstPtr &ptr) const
Definition: class.cpp:288
Additional stats for NPCs.
Definition: npcstats.hpp:21
virtual float getCapacity(const MWWorld::Ptr &ptr) const
Definition: class.cpp:206
virtual bool allowTelekinesis(const MWWorld::ConstPtr &ptr) const
Return whether this class of object can be activated with telekinesis.
Definition: class.hpp:292
virtual bool hasInventoryStore(const Ptr &ptr) const
Does this object have an inventory store, i.e. equipment slots? (default implementation: false) ...
Definition: class.cpp:131
virtual MWGui::ToolTipInfo getToolTipInfo(const ConstPtr &ptr, int count) const
Definition: class.cpp:275
virtual void block(const Ptr &ptr) const
Definition: class.cpp:96
virtual bool canBeActivated(const Ptr &ptr) const
Definition: class.cpp:101
virtual void skillUsageSucceeded(const MWWorld::Ptr &ptr, int skill, int usageType, float extraFactor=1.f) const
Definition: class.cpp:48
virtual int getEnchantmentPoints(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:176
virtual float getNormalizedEncumbrance(const MWWorld::Ptr &ptr) const
Returns encumbrance re-scaled to capacity.
Definition: class.cpp:457
virtual MWMechanics::Movement & getMovementSettings(const Ptr &ptr) const
Return desired movement.
Definition: class.cpp:181
Class()
Definition: class.cpp:29
bool isPureLandCreature(const MWWorld::Ptr &ptr) const
Definition: class.cpp:410
virtual int getEffectiveArmorRating(const MWWorld::ConstPtr &armor, const MWWorld::Ptr &actor) const
Get the effective armor rating, factoring in the actor's skills, for the given armor.
Definition: class.cpp:485
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual int getBaseGold(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:437
virtual void insertObjectRendering(const Ptr &ptr, const std::string &mesh, MWRender::RenderingInterface &renderingInterface) const
Definition: class.cpp:33
virtual std::string getSoundIdFromSndGen(const Ptr &ptr, const std::string &type) const
Returns the sound ID for ptr of the given soundgen type.
Definition: class.cpp:265
virtual Ptr copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const
Definition: class.cpp:351
virtual int getBloodTexture(const MWWorld::ConstPtr &ptr) const
Get a blood texture suitable for ptr (see Blood Texture 0-2 in Morrowind.ini)
Definition: class.cpp:428
virtual std::string getSound(const MWWorld::ConstPtr &ptr) const
Returns sound id.
Definition: class.cpp:466
virtual void writeAdditionalState(const MWWorld::ConstPtr &ptr, ESM::ObjectState &state) const
Write additional state from ptr into state.
Definition: class.cpp:435
virtual Ptr copyToCell(const ConstPtr &ptr, CellStore &cell, int count) const
Definition: class.cpp:357
virtual InventoryStore & getInventoryStore(const Ptr &ptr) const
Definition: class.cpp:126
virtual bool canFly(const MWWorld::ConstPtr &ptr) const
Definition: class.cpp:379
virtual ~Class()
Definition: class.cpp:31
virtual float getJump(const MWWorld::Ptr &ptr) const
Return jump velocity (not accounting for movement)
Definition: class.cpp:171
virtual int getServices(const MWWorld::ConstPtr &actor) const
Definition: class.cpp:58
virtual void adjustPosition(const MWWorld::Ptr &ptr, bool force) const
Definition: class.cpp:324