feat: Primitive airfield navigation
This commit is contained in:
@@ -4,29 +4,35 @@
|
||||
|
||||
#include "../dxd_math.hpp"
|
||||
#include "world_object.hpp"
|
||||
#include "af_spawner.hpp"
|
||||
|
||||
namespace dxd::sim
|
||||
{
|
||||
|
||||
class AFSpawner;
|
||||
|
||||
class Airfield : public WorldObject
|
||||
{
|
||||
private:
|
||||
AFSpawner *_parent;
|
||||
vec2 _position;
|
||||
int _ttl;
|
||||
int _next_spawn;
|
||||
float _rw_heading;
|
||||
|
||||
const int _MIN_TAKEOFF_DELAY = 240;
|
||||
const int _MAX_TAKEOFF_DELAY = 600;
|
||||
const int _WR_LENGTH = 6;
|
||||
int const _MIN_TAKEOFF_DELAY = 600;
|
||||
int const _MAX_TAKEOFF_DELAY = 3000;
|
||||
int const _RW_LENGTH = 6;
|
||||
|
||||
public:
|
||||
Airfield(vec2 position, int ttl, float rw_heading)
|
||||
: _position(position), _ttl(ttl), _rw_heading(rw_heading)
|
||||
Airfield(AFSpawner *parent, vec2 position, int ttl, float rw_heading)
|
||||
: _parent(parent), _position(position), _ttl(ttl), _rw_heading(rw_heading)
|
||||
{
|
||||
_next_spawn = _MIN_TAKEOFF_DELAY;
|
||||
}
|
||||
|
||||
vec2 get_position() { return _position; }
|
||||
|
||||
void tick(float timestep, World *world) override;
|
||||
void draw(Renderer *rend) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user