add basic types and fix cmake

This commit is contained in:
2026-04-19 15:35:21 +02:00
parent ebf6cea353
commit 41fd2a83ee
30 changed files with 1562 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
#pragma once
#include <optional>
#include <string>
#include <vector>
#include "BuildingType.h"
// One entry in [[recipe]].inputs — amount units of a named item consumed per
// production cycle (REQ-MAT-CYCLE).
struct RecipeIngredient
{
std::string item;
int amount;
};
// One entry in [[recipe]].outputs. For reprocessing_plant recipes, probability
// is populated and outputs are rolled with weighted pick at cycle start
// (REQ-BLD-REPROCESSING, REQ-MAT-CYCLE). For other buildings, probability is
// std::nullopt and all outputs are produced on every cycle.
struct RecipeOutput
{
std::string item;
int amount;
std::optional<double> probability;
};
struct RecipeDef
{
std::string id; // Unique recipe id; used by UI for selection.
BuildingType building; // Which BuildingType can run this recipe.
std::vector<RecipeIngredient> inputs;
std::vector<RecipeOutput> outputs;
double durationSeconds;
};
struct RecipesConfig
{
std::vector<RecipeDef> recipes;
};