All pastes #375884 Raw Edit

player.cpp

public cpp v1 · immutable
#375884 ·published 2007-02-28 18:13 UTC
rendered paste body
#include "weapon.cpp"class Player { public:  void setHealth(int h);  void setAmmo(int a);  void setClips(int c);  int getAmmo();  int getHealth();  int getClips();  Weapon getBackWeapon();  Weapon getWeapon();  void reload();  void Reset(); private:  int health;  int ammo;  int clips;  Weapon wpn;   Weapon back;};void Player::setHealth(int h) { health = h;};void Player::setAmmo(int a){  ammo = a;};void Player::setClips(int c){ clips = c;};int Player::getHealth()  { return health; };int Player::getAmmo()  { return ammo; };int Player::getClips() { return clips; };Weapon Player::getWeapon()  { return wpn; };Weapon Player::getBackWeapon()  { return back; };void Player::reload() { clips--; ammo = ammo + 10; // play reloading anim};void Player::Reset()  // Reset the player{ health = 100; ammo = 10; clips = 5;};