Code Search for Developers
 
 
  

IWeapon.h from palisma2d at Krugle


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

palisma2d

The University of Wisconsin-Parkside Developers Union first product. More info to come. Code name Palisma.

Project homepage: http://code.google.com/p/palisma2d/
Programming language(s): C,C++
License: gpl2

  DialogModel.cpp
  DialogModel.h
  DialogState.cpp
  DialogState.h
  Enemy.cpp
  Enemy.h
  EntityController.cpp
  EntityController.h
  EntityEvents.cpp
  EntityEvents.h
  EntityFactory.cpp
  EntityFactory.h
  EntityManager.cpp
  EntityManager.h
  EntityStates.cpp
  EntityStates.h
  Event.h
  HUD.cpp
  HUD.h
  IEntity.cpp
  IEntity.h
  IWeapon.cpp
  IWeapon.h
  InGameState.cpp
  InGameState.h
  Inventory.cpp
  Inventory.h
  MissionHolder.cpp
  MissionHolder.h
  Player.cpp
  Player.h
  PlayerConfig.cpp
  PlayerConfig.h
  PlayerController.cpp
  PlayerController.h
  QuestImporter.cpp
  QuestImporter.h
  ReadMe.txt
  Scene.cpp
  Scene.h
  Shotgun.cpp
  Shotgun.h
  State.h
  StateFactory.cpp
  StateFactory.h
  StateMachine.cpp
  StateMachine.h
  Tile.cpp
  Tile.h
  Weather.cpp
  Weather.h
  stdafx.cpp
  stdafx.h