add basic types and fix cmake
This commit is contained in:
84
src/lib/config/ShipsConfig.h
Normal file
84
src/lib/config/ShipsConfig.h
Normal file
@@ -0,0 +1,84 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Formula.h"
|
||||
#include "RecipesConfig.h" // for RecipeIngredient
|
||||
|
||||
// Build materials and initial per-blueprint production level
|
||||
// (REQ-BLD-SHIPYARD, REQ-DEF-BLUEPRINT-DROP).
|
||||
struct ShipBlueprint
|
||||
{
|
||||
std::vector<RecipeIngredient> materials;
|
||||
int playerProductionLevel;
|
||||
};
|
||||
|
||||
// Wave scheduling cost (REQ-WAV-THREAT-COST). Ships with cost_formula that
|
||||
// always evaluates to 0 are ineligible as wave picks.
|
||||
struct ShipThreat
|
||||
{
|
||||
Formula costFormula;
|
||||
};
|
||||
|
||||
struct ShipHealth
|
||||
{
|
||||
Formula hpFormula; // REQ-SHP-STATS
|
||||
};
|
||||
|
||||
struct ShipMovement
|
||||
{
|
||||
Formula speedFormula; // REQ-SHP-STATS, REQ-SHP-MOVEMENT
|
||||
};
|
||||
|
||||
struct ShipCombat
|
||||
{
|
||||
Formula damageFormula;
|
||||
Formula attackRangeFormula;
|
||||
Formula attackRateFormula; // shots per second
|
||||
};
|
||||
|
||||
// Optional; present only on salvage ships (REQ-SHP-SALVAGE).
|
||||
struct ShipSalvage
|
||||
{
|
||||
double collectionRange;
|
||||
int cargoCapacity;
|
||||
};
|
||||
|
||||
// Optional; present only on repair ships (REQ-SHP-REPAIR).
|
||||
struct ShipRepair
|
||||
{
|
||||
Formula repairRateFormula;
|
||||
Formula repairRangeFormula;
|
||||
};
|
||||
|
||||
// Scrap dropped on destruction (REQ-RES-SCRAP-DROP).
|
||||
struct ShipLoot
|
||||
{
|
||||
int scrapDrop;
|
||||
};
|
||||
|
||||
struct ShipDef
|
||||
{
|
||||
std::string id;
|
||||
bool availableFromStart;
|
||||
|
||||
ShipBlueprint blueprint;
|
||||
ShipThreat threat;
|
||||
ShipHealth health;
|
||||
ShipMovement movement;
|
||||
ShipLoot loot;
|
||||
|
||||
// Role-specific sections. A ship is a combat ship if combat is present,
|
||||
// a salvage ship if salvage is present, etc. A ship may have multiple
|
||||
// of these set (hybrid ships) once the behavior systems support it.
|
||||
std::optional<ShipCombat> combat;
|
||||
std::optional<ShipSalvage> salvage;
|
||||
std::optional<ShipRepair> repair;
|
||||
};
|
||||
|
||||
struct ShipsConfig
|
||||
{
|
||||
std::vector<ShipDef> ships;
|
||||
};
|
||||
Reference in New Issue
Block a user