cargo component refactoring
This commit is contained in:
@@ -4,6 +4,7 @@ SET(HDRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/AttackBehavior.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BehaviorKind.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BehaviorScores.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CargoComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DeliverScrapBehavior.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DespawnAtComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DynamicBodyComponent.h
|
||||
@@ -17,7 +18,7 @@ SET(HDRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/RepairBehavior.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/RepairToolComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/RetreatBehavior.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SalvageCargoComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SalvagerComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SalvageScrapBehavior.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ScrapDataComponent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SelectedBehaviorComponent.h
|
||||
|
||||
10
src/lib/ecs/component/CargoComponent.h
Normal file
10
src/lib/ecs/component/CargoComponent.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// Single shared salvage cargo pool for a ship (REQ-MOD-CARGO-CAPACITY). Attached
|
||||
// to a ship at spawn only when its cargo capacity stat is greater than 0. All of
|
||||
// the ship's salvage modules deposit into this one pool; delivery draws from it.
|
||||
struct CargoComponent
|
||||
{
|
||||
int maxCapacity;
|
||||
int current;
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
struct SalvageCargoComponent
|
||||
{
|
||||
int capacity;
|
||||
int current;
|
||||
float collectionRange_tiles;
|
||||
int collectionIntervalTicks;
|
||||
int cooldownTicksRemaining;
|
||||
};
|
||||
11
src/lib/ecs/component/SalvagerComponent.h
Normal file
11
src/lib/ecs/component/SalvagerComponent.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Per-instance salvage collection emitter. Each placed salvage module owns one of
|
||||
// these and runs its own collection cycle on its own cooldown. The collected scrap
|
||||
// is stored in the owning ship's shared CargoComponent (REQ-SHP-SALVAGE), not here.
|
||||
struct SalvagerComponent
|
||||
{
|
||||
float collectionRange_tiles;
|
||||
int collectionIntervalTicks;
|
||||
int cooldownTicksRemaining;
|
||||
};
|
||||
Reference in New Issue
Block a user