implement ship behaviors

This commit is contained in:
2026-04-20 08:29:53 +02:00
parent 8b84297b41
commit 65de4ddc5c
11 changed files with 1124 additions and 14 deletions

View File

@@ -10,6 +10,7 @@
#include <vector>
#include <QPoint>
#include <QVector2D>
#include "BeltSystem.h"
#include "Building.h"
@@ -60,6 +61,16 @@ public:
std::vector<ConstructionSite> allSites() const;
bool isTileOccupied(QPoint tile) const;
// Find nearest operational building of the given type; nullptr if none.
const Building* findNearestBuilding(QVector2D worldPos, BuildingType type) const;
// Place one "scrap" item into a SalvageBay's output buffer.
// Returns false if bay not found, wrong type, or output buffer is full.
bool deliverScrapToSalvageBay(EntityId bayId);
// Increase a building's HP by amount, clamped to maxHp.
void healBuilding(EntityId id, float amount);
private:
struct BeltEntry
{