
/* -------------------------------------------------
* Copyright 2005 Machineworks Northwest - All Rights reserved
* Programmer(s):  Seth A. Robinson (seth@rtsoft.com): 
* Created 4/16/2005 9:34:22 PM
*/


#pragma once

#include "main.h"
#include "Entity.h"

enum
{
        C_KEY_UP  = 0x0001,
        C_KEY_DOWN = 0x0002,
        C_KEY_LEFT  =  0x0004,
        C_KEY_RIGHT =  0x0008,
        C_KEY_SELECT =  0x0010,
        C_KEY_SOFT1 =  0x0020,
        C_KEY_STRAFE_LEFT =  0x0040,
        C_KEY_STRAFE_RIGHT =  0x0080,
        C_KEY_PREV_WEAPON =  0x0100,
        C_KEY_NEXT_WEAPON =  0x0200

};

class EntPlayer: public Entity
{
    
public:
    EntPlayer();
    virtual ~EntPlayer();

    bool Init();
    
    void Render();
    void Update(float step);
    void ResetKeys();
    int GetHealthPercent();
    void RepairHull();
    float m_boatPower, m_boatMaxSpeed;
    int m_health;
    void OnCrash(int damage);

private: 
  
    void OnKeyUp(const CL_InputEvent &key);
    void OnKeyDown(const CL_InputEvent &key);
    void SetSpriteData(CL_Sprite *pSprite);
    void UpdateMovement(float step);
   
    unsigned int m_Keys; //holds current state of player movement keys
    CL_Slot m_SlotKeyUp;
    CL_Slot m_SlotKeyDown;
  
    CL_Sprite *m_sprite;
    CL_Sprite *m_spriteMoving;
    CL_Sprite *m_spriteIdle;
    CL_Sprite *m_spriteLastUsed;
    int m_shieldTimer; 
    float m_turnSpeed;
     bool m_bHandledDeath;
};