48 lines
No EOL
1 KiB
C++
48 lines
No EOL
1 KiB
C++
#ifndef __FLASHLIGHT_H__
|
|
#define __FLASHLIGHT_H__
|
|
|
|
#include "g_local.h"
|
|
#include "inventoryitem.h"
|
|
|
|
class EXPORT_FROM_DLL Flashlight : public InventoryItem
|
|
{
|
|
private:
|
|
EntityPtr lightent;
|
|
EntityPtr lightent2;
|
|
|
|
public:
|
|
int lighton;
|
|
|
|
CLASS_PROTOTYPE(Flashlight);
|
|
|
|
Flashlight();
|
|
~Flashlight();
|
|
virtual void Use(Event *ev);
|
|
void EmitLight(Event *ev);
|
|
virtual qboolean Pickupable(Entity *other);
|
|
virtual Item *ItemPickup(Entity *other);
|
|
virtual void Pickup(Event *ev);
|
|
|
|
virtual void Archive(Archiver &arc);
|
|
virtual void Unarchive(Archiver &arc);
|
|
};
|
|
|
|
inline EXPORT_FROM_DLL void Flashlight::Archive (Archiver &arc)
|
|
{
|
|
InventoryItem::Archive(arc);
|
|
|
|
arc.WriteSafePointer(lightent);
|
|
arc.WriteSafePointer(lightent2);
|
|
arc.WriteInteger(lighton);
|
|
}
|
|
|
|
inline EXPORT_FROM_DLL void Flashlight::Unarchive (Archiver &arc)
|
|
{
|
|
InventoryItem::Unarchive(arc);
|
|
|
|
arc.ReadSafePointer(&lightent);
|
|
arc.ReadSafePointer(&lightent2);
|
|
arc.ReadInteger(&lighton);
|
|
}
|
|
|
|
#endif |