39 lines
766 B
C++
39 lines
766 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <deque>
|
|
#include <list>
|
|
|
|
#include <glm/vec2.hpp>
|
|
#include <glm/vec3.hpp>
|
|
|
|
namespace game {
|
|
class Ship;
|
|
class Command;
|
|
class Missile;
|
|
|
|
class Player {
|
|
public:
|
|
int id;
|
|
bool alive;
|
|
float speed;
|
|
float energy;
|
|
float deadTimeCounter;
|
|
Ship *ship;
|
|
std::string name;
|
|
std::list<Missile*> missiles;
|
|
|
|
Player(int id) : id(id), alive(true), speed(1.0), energy(0.0), ship(nullptr), name("<unnamed>")
|
|
{
|
|
}
|
|
|
|
void addCommand(Command *cmd);
|
|
bool hasCommandInQueue();
|
|
|
|
Command *peekCommand();
|
|
void popCommand();
|
|
|
|
private:
|
|
std::deque<Command*> commands;
|
|
};
|
|
}
|