mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef VEHICLE_H
|
|
#define VEHICLE_H
|
|
|
|
#include "unit.h"
|
|
|
|
namespace vb01{
|
|
class Material;
|
|
}
|
|
|
|
namespace battleship{
|
|
class Garrisonable;
|
|
|
|
class Vehicle : public Unit{
|
|
public:
|
|
Vehicle(Player*, int, vb01::Vector3, vb01::Quaternion);
|
|
~Vehicle();
|
|
void move(Order);
|
|
void garrison(Garrisonable*);
|
|
bool isGarrisoned(){return garrisoned;}
|
|
private:
|
|
bool pursuingTarget = false, garrisoned = false;
|
|
int patrolPointId = 0;
|
|
float speed, maxTurnAngle, anglePrecision;
|
|
vb01::Material *debugMat = nullptr;
|
|
std::vector<vb01::Node*> debugPathPoints;
|
|
|
|
inline int getNextPatrolPointId(int numPoints) {return patrolPointId == numPoints - 1 ? 0 : patrolPointId + 1;}
|
|
void halt();
|
|
void turn(float);
|
|
void addOrder(Order);
|
|
void advance(float, MoveDir = MoveDir::FORW);
|
|
void preparePathpoints(Order);
|
|
void removePathpoint(int = 0);
|
|
void removeAllPathpoints();
|
|
protected:
|
|
std::vector<vb01::Vector3> pathPoints;
|
|
|
|
void navigate(Order, float = 0.);
|
|
void alignToSurface();
|
|
void attack(Order);
|
|
virtual void initProperties();
|
|
virtual void fire();
|
|
};
|
|
}
|
|
|
|
#endif
|