CWeaponDefPool Class Reference

Singleton used to store all the weapon definitions used in the game. More...

#include <weapon.h>

List of all members.

Static Public Member Functions

static CWeaponDef::eFiremode string_to_eFiremode (const char *str)
 take a string and return the eFiremode enum
static CWeaponDef::eType string_to_eType (const char *str)
 take a string and return the eType enum
Create methods
This is a singleton

static CWeaponDefPoolinstance ()
 Get an instance.
static void clear ()
 Clear out the entire pool.
Load/Reload methods
static bool load (const std::string &filename, const std::string &path)
static bool load (const std::string &filename)
static bool load (CXMLNode node)
 
Parameters:
node CWeaponDefPool XML node

Info methods
static int size ()
 
Returns:
The size (0 if no pool).


Static Public Attributes

XML tags
<Weapon name="handgun" type="trace" range="3000" damage="35" cycle="2" firemode="single" reload="32" clipsize="12" accuracy="5" ammotype="1"/ >

static const char * m_kStrElmWeaponDefPool = "WeaponDefPool"
static const char * m_kStrElmWeapon = "Weapon"
static const char * m_kStrAttName = "name"
 name of the weapon
static const char * m_kStrAttType = "type"
 type of weapon
static const char * m_kStrAttRange = "range"
 weapon range
static const char * m_kStrAttDamage = "damage"
 damage per shot
static const char * m_kStrAttCycle = "cycle"
 time between shots (ticks)
static const char * m_kStrAttFiremode = "firemode"
 single, auto, burst
static const char * m_kStrAttReload = "reload"
 time to reload the weapon
static const char * m_kStrAttClipsize = "clipsize"
 max number of rounds in the clip
static const char * m_kStrAttAccuracy = "accuracy"
 base accuracy of the weapon
static const char * m_kStrAttAmmoType = "ammotype"
 type of ammo this weapon uses
static const char * m_kStrAttShotSound = "shot"
 sound made when firing
static const char * m_kStrElmFX = "WeaponFX"
 FX Element.
static const char * m_kStrAttShotFX = "shot_fx"
 shot FX attribute
static const char * m_kStrAttHitFX = "hit_fx"
 hit point FX attribute
static const char * m_kStrAttMuzzleFX = "muzzle_fx"
 muzzle FX attribute


Detailed Description

Singleton used to store all the weapon definitions used in the game.

(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.

Author:
Doug Poston
Version:
1.3
Date:
12/28/2007

Member Function Documentation

bool CWeaponDefPool::load ( const std::string &  filename,
const std::string &  path 
) [static]

Parameters:
filename The filename of the XML weapon data file
path Additional path (if not part of filename)
Returns:
true if the load succeeds

bool CWeaponDefPool::load ( const std::string &  filename  )  [static]

Parameters:
filename The filename of the XML weapon data file
Returns:
true if the load succeeds


Member Data Documentation

const char * CWeaponDefPool::m_kStrAttType = "type" [static]

type of weapon

type of weapon (shot type)

const char * CWeaponDefPool::m_kStrAttFiremode = "firemode" [static]

single, auto, burst

single, auto, burst, shotgun

const char * CWeaponDefPool::m_kStrElmFX = "WeaponFX" [static]

FX Element.

WeaponFX Element.


The documentation for this class was generated from the following files:
Generated on Fri Dec 28 12:55:08 2007 for template7 by  doxygen 1.5.4