Implement config-driven unlock groups so that multiple things can be unlocked at once (including buildings)
This commit is contained in:
26
src/lib/config/UnlocksConfig.h
Normal file
26
src/lib/config/UnlocksConfig.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// A single [[unlock]] entry from unlocks.toml — an unlock group, the unit of
|
||||
// loot awarded by defence station drops (REQ-DEF-SCHEMATIC-DROP,
|
||||
// REQ-LOCK-EXPLICIT). Awarding a group unlocks all of its granted members at
|
||||
// once. Anything not granted by any group is available from game start.
|
||||
struct UnlockGroupDef
|
||||
{
|
||||
std::string id; // Unique unlock-group id.
|
||||
int stationLevel; // Min destroyed station level to become eligible.
|
||||
std::vector<std::string> requiredGroupIds; // Prerequisite unlock-group ids (REQ-LOCK-PREREQ).
|
||||
|
||||
// Granted ids by kind (each defaults to empty; a group grants >= 1 item).
|
||||
std::vector<std::string> ships;
|
||||
std::vector<std::string> modules;
|
||||
std::vector<std::string> buildings;
|
||||
std::vector<std::string> recipes; // Assembler recipe ids only.
|
||||
};
|
||||
|
||||
struct UnlocksConfig
|
||||
{
|
||||
std::vector<UnlockGroupDef> groups;
|
||||
};
|
||||
Reference in New Issue
Block a user