//-----------------------------------------------------------------------------
//
//  $Logfile:: /game/object.h                                                 $
// $Revision:: 2                                                              $
//   $Author:: Burgermac                                                      $
//     $Date:: 12/27/00 6:51 PM                                               $
//
// Copyright (C) 1997 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// DESCRIPTION:
// Object class
//

#ifndef __OBJECT_H__
#define __OBJECT_H__

#include "g_local.h"
#include "entity.h"
#include "specialfx.h"

class Object : public Entity
{
private:
public:
	CLASS_PROTOTYPE( Object );
	/*Object::*/ Object();
	void              Killed( Event* ev );
};

extern Event EV_ThrowObject_Pickup;
extern Event EV_ThrowObject_Throw;

class ThrowObject : public Object
{
private:
	int owner;
	Vector pickup_offset;
	str throw_sound;
public:
	CLASS_PROTOTYPE( ThrowObject );
	/*ThrowObject::*/ ThrowObject();
	void              Touch( Event* ev );
	void              Throw( Event* ev );
	void              Pickup( Event* ev );
	void              PickupOffset( Event* ev );
	void              ThrowSound( Event* ev );
	virtual void      Archive( Archiver& arc );
	virtual void      Unarchive( Archiver& arc );
};

inline void ThrowObject::Archive( Archiver& arc )
{
	Object::Archive( arc );

	arc.WriteInteger( owner );
	arc.WriteVector( pickup_offset );
	arc.WriteString( throw_sound );
}

inline void ThrowObject::Unarchive( Archiver& arc )
{
	Object::Unarchive( arc );

	owner = arc.ReadInteger();
	arc.ReadVector( &pickup_offset );
	arc.ReadString( &throw_sound );
}


class FireBarrel : public Object
{
private:
	FireSprite*        fire;
public:
	CLASS_PROTOTYPE( FireBarrel );
	/*FireBarrel::*/ FireBarrel();
	/*FireBarrel::*/ ~FireBarrel();
	virtual void      Archive( Archiver& arc );
	virtual void      Unarchive( Archiver& arc );
};

inline void FireBarrel::Archive( Archiver& arc )
{
	Object::Archive( arc );

	arc.WriteObjectPointer( fire );
}

inline void FireBarrel::Unarchive( Archiver& arc )
{
	Object::Unarchive( arc );

	arc.ReadObjectPointer( ( Class** )&fire );
}

#endif /* object.h */
