Show IWeapon.h syntax highlighted
#pragma once
#include "IEntity.h"
/**
=======================
A bullet -
=======================
*/
class IBullet : public IEntity
{
};
/**
=======================
Base class for a weapon
=======================
*/
class IWeapon : public IEntity
{
public:
IWeapon(void);
/** Get the Entity Type */
virtual int GetType() { return TYPE_WEAPON; };
/** Apply Common Dictionary Attributes */
///void Apply();
/** Update */
virtual void Update(long deltaTime);
/** Fire this weapon */
virtual void Fire();
/** Reload this weapon */
virtual void Reload();
/** Collide with this weapon */
virtual bool CollideWith( IEntity *ent );
/** Weapon is Ready */
bool IsReady();
/** Weapon is Firing */
bool IsFiring();
/** Weapon is reloading */
bool IsReloading();
/** Item is Idle, on the ground */
bool CanPickUp();
/** Get the owner of this weapon */
IEntity* GetOwner() { return m_owner; };
/** Set the owner of this weapon */
void SetOwner(IEntity* owner) { m_owner = owner; };
protected:
/** Check for reload */
void CheckAutoReload();
// how long it takes to fire
float m_weaponTime;
// how long it takes to reload
float m_reloadTime;
// owner of this weapon
IEntity* m_owner;
// Weapon hit collision bounds
Rect m_hitBounds;
public:
virtual ~IWeapon(void);
};
See more files for this project here