2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 22:09:57 +00:00
|
|
|
#include "Entity.h"
|
2013-08-19 11:39:13 +02:00
|
|
|
#include "../Item.h"
|
2012-12-28 02:45:20 +00:00
|
|
|
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPlayer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-24 07:58:26 +00:00
|
|
|
// tolua_begin
|
|
|
|
class cPickup :
|
|
|
|
public cEntity
|
|
|
|
{
|
|
|
|
// tolua_end
|
|
|
|
typedef cEntity super;
|
|
|
|
|
2012-06-14 13:06:06 +00:00
|
|
|
public:
|
2012-12-21 12:21:20 +00:00
|
|
|
CLASS_PROTODEF(cPickup);
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-09-20 22:02:11 +02:00
|
|
|
cPickup(double a_X, double a_Y, double a_Z, const cItem & a_Item, float a_SpeedX = 0.f, float a_SpeedY = 0.f, float a_SpeedZ = 0.f); // tolua_export
|
2012-08-24 07:58:26 +00:00
|
|
|
|
2013-01-12 04:46:01 +00:00
|
|
|
cItem & GetItem(void) {return m_Item; } // tolua_export
|
2012-12-28 02:45:20 +00:00
|
|
|
const cItem & GetItem(void) const {return m_Item; }
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2012-08-24 07:58:26 +00:00
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-01-12 04:46:01 +00:00
|
|
|
virtual bool CollectedBy(cPlayer * a_Dest); // tolua_export
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-04-13 21:02:10 +00:00
|
|
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-03-09 14:35:43 +00:00
|
|
|
/// Returns the number of ticks that this entity has existed
|
2013-08-19 11:44:11 +02:00
|
|
|
int GetAge(void) const { return (int)(m_Timer / 50); } // tolua_export
|
2013-03-09 14:35:43 +00:00
|
|
|
|
2013-08-19 11:58:20 +02:00
|
|
|
/// Returns true if the pickup has already been collected
|
|
|
|
bool IsCollected(void) const { return m_bCollected; } // tolua_export
|
|
|
|
|
2012-06-14 13:06:06 +00:00
|
|
|
private:
|
2013-02-21 21:55:36 +00:00
|
|
|
Vector3d m_ResultingSpeed; //Can be used to modify the resulting speed for the current tick ;)
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-02-21 21:55:36 +00:00
|
|
|
Vector3d m_WaterSpeed;
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-08-19 11:44:11 +02:00
|
|
|
/// The number of ticks that the entity has existed / timer between collect and destroy; in msec
|
2012-06-14 13:06:06 +00:00
|
|
|
float m_Timer;
|
|
|
|
|
2012-12-28 02:45:20 +00:00
|
|
|
cItem m_Item;
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
bool m_bCollected;
|
2013-01-12 04:46:01 +00:00
|
|
|
}; // tolua_export
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|