#ifndef SHIP_H
#define SHIP_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "BulletS.h"

/** Ship Class
@author Joshua Ohara, el18jkeo, 201291390
@brief Controls the ship  
@date May 2020
*/ 

class Ship
{
    
public: 
    Ship();
    ~Ship();
    void init(int height, int width);                                           //initialises ship object, sets private variables
    void render(N5110 &lcd);                                                    //draws ship if alive
    void update(Direction d, float mag, Gamepad &pad, N5110 &lcd, int counter); //updates the position and shooting of the ship      
    //accessors and mutators   
    void set_life(bool life);                                                   //sets the life of the ship
    bool get_life();                                                            //returns the life of the ship
    void set_bullet_hit(int i, bool hit);                                       //sets the life of a given ship bullet (hit if a collsion occurs)
    Vector2D get_position();                                                    //returns the position of the ship for collision check
    vector<ShipBullet> get_bullet_vector();                                         //returns the ship bullet vector for collsion check
    
private:
    int _height;                                                                 //height of the ship main rectangle
    int _width;                                                                  //width of the ship main rectangle
    int _x;                                                                      //x posittion of ship
    int _y;                                                                      //y position of the ship
    int _speed;                                                                  //speed of the ship in x direction
    bool _life;                                                                  //whether the ship is alive or not
    BulletS _ship_bullet_vector;                                                 //object to create ship bullet vector
};

#endif