/*
 * (C) Copyright Chris B. Kaynor 2006
 * All Rights Reserved.
 *
 * CONTACT: chris@kaynor.net
*/

#ifndef CBK_OBJECT_DATA_H
#define CBK_OBJECT_DATA_H

#include "Settings.h"
#include "vector.h"
#include "Macros.h"

class cbk_object_data {
public:
	cbk_object_data(void);

	GLint update(GLfloat time_slice);

	void change_movement_speed(GLfloat Speed);
	void change_rotation_speed(GLfloat Speed);

	void change_movement_decay(GLfloat Movement_Decay);
	void change_rotation_decay(GLfloat Rotation_Decay);

	void set_texture(GLuint TextureID);

	void move(GLfloat X_Cord, GLfloat Y_Cord, GLfloat Z_Cord);
	void move(cbk_vector Position);

	void rotate(GLfloat X_Rotate, GLfloat Y_Rotate, GLfloat Z_Rotate);
	void rotate(cbk_vector Rotation);

	void SetLifeTime(GLfloat LifeTime);
	GLfloat GetLifeTime();

	cbk_vector get_position(void);
	cbk_vector get_rotation(void);
	GLfloat get_movement_speed(void);
	GLfloat get_rotation_speed(void);
	cbk_vector get_velocity(void);

	GLfloat GetCollsionSize(void);
	void SetCollsionSize(GLfloat);

	GLfloat TurboCoolDownTime;
	GLfloat TurboTimeRemaining;

protected:
	cbk_vector c_position;
	cbk_vector c_rotation;

	GLfloat c_movement_speed;
	GLfloat c_rotation_speed;

	GLfloat c_CollisonSize;

	GLuint c_texture_id;

	GLfloat c_LifeTime;

	GLfloat c_Movement_Decay;
	GLfloat c_Rotation_Decay;
};

class cbk_object_data_tank: public cbk_object_data {
public:
	cbk_object_data_tank(void) : cbk_object_data(){};

	void draw(cbk_object_data_tank PlayerView);

	void Accelerate(GLfloat Dt);
	void Decelerate();
	void TurnRight();
	void TurnLeft();

	long Score;
	long ShotsFired;
	long Kills;

	signed int Turning; 

	GLfloat FireCoolDownTime;
};

class cbk_object_data_static: public cbk_object_data {
public:
	cbk_object_data_static(void) : cbk_object_data(){};

	void draw(cbk_object_data_tank PlayerView);
};


class cbk_object_data_projectile: public cbk_object_data {
public:
	cbk_object_data_projectile(void) : cbk_object_data(){};

	void draw(cbk_object_data_tank PlayerView);

	int Firer;
};

#endif /* CBK_OBJECT_DATA_H */
