//
// playership.h
//
// game player's ship
//
//
// Author: Tomi Belan <tomi.belan@gmail.com>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef _playership_h_
#define _playership_h_

#include "gameobject.h"

class PlayerShip : public GameObject {
private:
  GameHandler *handler;
  double direction; // in radians
  double velocity;
  
  int maxhp;
  int hp;
  
  int shipSpeed;
  
  int getPhase();
public:
  PlayerShip(GameHandler*, int playerId);
  virtual ~PlayerShip();
  
  virtual void update(SDL_Surface *where);
  
  void keyboard();
  void move();
  
  bool tryToNotCollideWithBarriers();
  SDL_Rect myCollisionRect();
  bool collidesWith(SDL_Rect);
  void wasHit();
  void shoot();
  void teleport();
  
  void setReloading(int n, int max = -1);
  
  int reloading;
  int maxReloading;
  int teleportRecharge;
  int teleportCounter;
  
  void relocate();
  
  SDL_Rect rect;
  
  int playerId;
};

#endif

