//
// Asura_Physics_ForceField.h
//
// Created by KJFL - 18 April 2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_PHYSICS_FORCEFIELD_H__
#define __ASURA_PHYSICS_FORCEFIELD_H__

class Asura_Physics_ForceField
{
	public:

		// constructor merely gets a guid and adds itself to the list
		Asura_Physics_ForceField();

		// destructor must remove instance from list
		virtual ~Asura_Physics_ForceField();
		
		// These two functions are so named in order to use Asura_Hashed_List
		// I don't actually use the guid for anything atm, but I delete things
		// marked as destroyed during the Physics update
		u_int GetGuid() const { return m_uGuid; }
		bool IsDestroyed() const { return m_bIsDestroyed; }

		// Active flag - might as well be in the base class too
		bool IsActive( void ) const { return m_bIsActive; }
		void SetActive( bool bActive ) { m_bIsActive = bActive; }

		// virtual functions derived classes will need to implement
		virtual void Update( void ) = 0;
		virtual void DebugRender( void ) = 0;

		// static methods to be used by Asura_Physics_System *ONLY*
		// these affect all force fields
		static void UpdateAll( void );
		static void ResetAll( void );
		static void DebugRenderAll( void );

	private: 

		// KJFL - base data is private so nothing can accidentally 
		// change it, including derived classes. 
		u_int m_uGuid;

		u_int m_bIsDestroyed	:1;
		u_int m_bIsActive		:1;
};

#endif//__ASURA_PHYSICS_FORCEFIELD_H__

