Robot Devastation
Public Member Functions | Static Public Attributes | Private Attributes | List of all members

Class that represents a weapon.

#include <Weapon.hpp>

Public Member Functions

 Weapon ()
 Constructs a default, dummy weapon. (That is invalid for the game, by the way)
 
 Weapon (const std::string &name, int damage, int max_ammo)
 
bool canShootTarget (const Target &target)
 Checks if the target is within the weapon's current range and can be hit by it.
 
bool reload ()
 Increases the current ammo to max_ammo.
 
const std::string & getName () const
 
int getDamage () const
 
int getCurrentAmmo () const
 
bool setCurrentAmmo (int current_ammo)
 
int getMaxAmmo () const
 

Static Public Attributes

static const int SCOPE_X = 640/2
 X coordinate of the weapon's scope.
 
static const int SCOPE_Y = 480/2
 Y coordinate of the weapon's scope.
 

Private Attributes

std::string name
 
int damage
 Damage that this weapon can inflict in one shot.
 
int current_ammo
 Current ammount of ammo.
 
int max_ammo
 Maximum ammount of ammo.
 

The documentation for this class was generated from the following files: