Danbias/Code/Game/GameLogic/Player.h

83 lines
2.4 KiB
C
Raw Normal View History

2013-11-28 08:33:29 +01:00
//////////////////////////////////////////////////
//Created by Erik and Linda of the GameLogic team
//////////////////////////////////////////////////
2013-11-19 11:07:14 +01:00
#ifndef PLAYER_H
#define PLAYER_H
#include "GameLogicStates.h"
2013-12-10 11:17:25 +01:00
#include "OysterMath.h"
#include "DynamicObject.h"
2013-11-19 11:07:14 +01:00
namespace GameLogic
{
class Weapon;
class Player : public DynamicObject
2013-11-19 11:07:14 +01:00
{
public:
2013-12-05 11:50:39 +01:00
Player(void);
2013-11-19 11:07:14 +01:00
~Player(void);
/********************************************************
* Moves the player based on input
* @param movement: enum value on what kind of action is to be taken
********************************************************/
void Move(const PLAYER_MOVEMENT &movement);
2013-12-20 09:42:02 +01:00
void MoveForward();
void MoveBackwards();
void MoveRight();
void MoveLeft();
/********************************************************
* Uses the weapon based on input
* @param fireInput: enum value on what kind of action is to be taken
********************************************************/
2014-01-16 11:17:19 +01:00
void UseWeapon(const WEAPON_FIRE &usage);
/********************************************************
* Respawns the player, this resets several stats and settings on the player
* @param spawnPoint: the coordinate in the world where the player is to spawn
********************************************************/
void Respawn(Oyster::Math::Float3 spawnPoint);
2014-01-21 16:11:02 +01:00
void Rotate(float x, float y);
2014-01-21 16:08:55 +01:00
/********************************************************
* Collision function for player, this is to be sent to physics through the subscribe function with the rigidbody
* Will be called when the physics detect a collision
* @param rigidBodyPlayer: physics object of the player
* @param obj: physics object for the object that collided with the player
********************************************************/
static Oyster::Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj);
bool IsWalking();
bool IsJumping();
bool IsIdle();
Oyster::Math::Float3 GetPosition() const;
Oyster::Math::Float3 GetLookDir() const;
Oyster::Math::Float4x4 GetOrientation() const;
int GetTeamID() const;
PLAYER_STATE GetState() const;
void DamageLife(int damage);
private:
void Jump();
2013-11-19 18:35:35 +01:00
private:
int life;
int teamID;
Weapon *weapon;
PLAYER_STATE playerState;
Oyster::Math::Float4 lookDir;
bool hasTakenDamage;
float invincibleCooldown;
2013-11-19 11:07:14 +01:00
};
}
#endif