2022-02-07 21:38:35 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tinyengine/ecs/system.hpp"
|
|
|
|
#include "tinyengine/tinyengine.hpp"
|
|
|
|
#include "game/global.hpp"
|
|
|
|
#include "game/component.hpp"
|
|
|
|
#include "game/entity.hpp"
|
|
|
|
|
|
|
|
class PhysicalSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void physicalStep(Entity* entity, float dt, MoveCmpt&, MotionCmpt&);
|
|
|
|
};
|
|
|
|
|
2022-02-09 22:33:06 +08:00
|
|
|
class MissileUpdateSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateMissile(float dt, BulletCmpt&, MoveCmpt&, MotionCmpt&);
|
|
|
|
};
|
|
|
|
|
2022-02-07 21:38:35 +08:00
|
|
|
class ColliRectCorrectSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void correctColliRect(MoveCmpt&, CollisionCmpt&);
|
|
|
|
};
|
|
|
|
|
2022-02-08 21:02:52 +08:00
|
|
|
class CollideSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
|
|
|
};
|
|
|
|
|
2022-02-07 21:38:35 +08:00
|
|
|
class CleanupSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
|
|
|
};
|
|
|
|
|
2022-02-09 22:33:06 +08:00
|
|
|
class WeaponCooldownSystem: public UpdateSystem {
|
2022-02-07 21:38:35 +08:00
|
|
|
public:
|
|
|
|
void Update(float dt) override;
|
2022-02-09 22:33:06 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void coolDown(SpaceshipWeaponCmpt& weapon, float dt);
|
2022-02-07 21:38:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class RenderEntitySystem: public RenderSystem {
|
|
|
|
public:
|
|
|
|
void Render() override;
|
|
|
|
|
|
|
|
private:
|
2022-02-09 22:33:06 +08:00
|
|
|
void renderEntity(Entity* entity, const RenderCmpt&, float rotation);
|
2022-02-08 21:02:52 +08:00
|
|
|
void renderCollideBox(Entity* entity);
|
2022-02-07 21:38:35 +08:00
|
|
|
};
|
2022-02-15 22:50:31 +08:00
|
|
|
|
|
|
|
class EnergyProductSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void coolDown(EnergyProductCmpt& cmpt, float dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
class AIUpdateSystem: public UpdateSystem {
|
|
|
|
public:
|
|
|
|
void Update(float) override;
|
|
|
|
};
|