- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# C:/Documents and Settings/jegan/Desktop/projectX/Weapon.h

Go to the documentation of this file.

    00001 #ifndef WEAPON_H
    00002 #define WEAPON_H
    00003
    00004 #include <string>
    00005
    00006 #include "SDL.h"
    00007
    00008 class Person;
    00009 class List;
    00010 class Sprite;
    00011
    00012 class Weapon
    00013 {
    00014 public:
    00015         Weapon();
    00016         Weapon(std::string filename, Person *shooter);
    00017
    00018         void load(List *info);
    00019         void shoot();
    00020         void update();
    00021
    00022         virtual Weapon *copy(Person *shooter);
    00023
    00024         void addAmmo(int dAmmo);
    00025         int getAmmo() {return _ammo;}
    00026         SDL_Rect drawAmmo(SDL_Rect);
    00027
    00028
    00029         std::string id() {return _id;}
    00030
    00031 protected:
    00032         Person *_shooter;
    00033
    00034         Sprite *_icon;
    00035
    00036         int _waitShoot;
    00037         int _framesSinceShoot;
    00038         int _bulletSpeed;
    00039         int _damage;
    00040
    00041         unsigned int _ammo;
    00042         unsigned int _ammoSize;
    00043
    00044         bool _spray;
    00045
    00046         int _sprayCount;
    00047
    00048         std::string _id;
    00049 };
    00050
    00051 class WeaponPunch: public Weapon
    00052 {
    00053 public:
    00054         WeaponPunch();
    00055         WeaponPunch(std::string filename, Person *shooter);
    00056         WeaponPunch *copy(Person *shooter);
    00057         void shoot();
    00058 };
    00059
    00060 #endif