refactor AI system
This commit is contained in:
@@ -1,15 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "AdvanceEvaluator.h"
|
||||
#include "AdvanceExecutor.h"
|
||||
#include "AttackEvaluator.h"
|
||||
#include "AttackExecutor.h"
|
||||
#include "DeliverScrapEvaluator.h"
|
||||
#include "DeliverScrapExecutor.h"
|
||||
#include "RallyEvaluator.h"
|
||||
#include "RallyExecutor.h"
|
||||
#include "RepairEvaluator.h"
|
||||
#include "RepairExecutor.h"
|
||||
#include "RetreatEvaluator.h"
|
||||
#include "RetreatExecutor.h"
|
||||
#include "SalvageScrapEvaluator.h"
|
||||
#include "SalvageScrapExecutor.h"
|
||||
|
||||
class BuildingSystem;
|
||||
class EntityAdmin;
|
||||
class ScrapSystem;
|
||||
|
||||
// Orchestrates ship-behavior decision-making in three batched phases:
|
||||
// 1. evaluators score each behavior and set its target data,
|
||||
// 2. selectWinningBehaviors picks the highest-scoring behavior per ship,
|
||||
// 3. executors run for the winning behavior, setting movement intent and
|
||||
// preferred module targets.
|
||||
// All world mutation (collection, healing, damage) is left to the module
|
||||
// systems (SalvagerSystem, RepairSystem, CombatSystem).
|
||||
class AiSystem
|
||||
{
|
||||
public:
|
||||
void tickHomeReturnBehavior(EntityAdmin& admin);
|
||||
void tickThreatResponseBehavior(EntityAdmin& admin, const BuildingSystem& buildings);
|
||||
void tickRepairBehavior(EntityAdmin& admin, BuildingSystem& buildings);
|
||||
void tickRepairTools(EntityAdmin& admin);
|
||||
void tickSalvageBehavior(EntityAdmin& admin, ScrapSystem& scraps, BuildingSystem& buildings);
|
||||
void tick(EntityAdmin& admin, const BuildingSystem& buildings, const ScrapSystem& scraps);
|
||||
|
||||
private:
|
||||
void selectWinningBehaviors(EntityAdmin& admin);
|
||||
|
||||
AdvanceEvaluator m_advanceEvaluator;
|
||||
RallyEvaluator m_rallyEvaluator;
|
||||
RetreatEvaluator m_retreatEvaluator;
|
||||
AttackEvaluator m_attackEvaluator;
|
||||
RepairEvaluator m_repairEvaluator;
|
||||
SalvageScrapEvaluator m_salvageScrapEvaluator;
|
||||
DeliverScrapEvaluator m_deliverScrapEvaluator;
|
||||
|
||||
AdvanceExecutor m_advanceExecutor;
|
||||
RallyExecutor m_rallyExecutor;
|
||||
RetreatExecutor m_retreatExecutor;
|
||||
AttackExecutor m_attackExecutor;
|
||||
RepairExecutor m_repairExecutor;
|
||||
SalvageScrapExecutor m_salvageScrapExecutor;
|
||||
DeliverScrapExecutor m_deliverScrapExecutor;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user