Skip to main content

Module crafting

Module crafting 

Source
Expand description

§Crafting & Economy System

A full crafting, workbench, economy, and market module for the Proof Engine.

§Sub-modules

  • recipes — Recipe definitions, ingredient/result types, quality tiers, crafting calculator, mastery system, and recipe discovery.
  • workbench — Crafting stations, job queues, fuel systems, and auto-crafters.
  • economy — Currency, shops, supply/demand simulation, trade offers, tax.
  • market — Auction house, bidding, buyouts, market history, and peer trade windows.

§Quick Start

use proof_engine::crafting::{
    RecipeBook, Economy, AuctionHouse, Workbench, WorkbenchType, WorkbenchTier,
    Currency,
};
use glam::Vec3;

// Load default recipes
let book = RecipeBook::default_recipes();

// Query smithing recipes available at skill level 10
let available = book.available_for_level_and_category(
    10,
    &proof_engine::crafting::recipes::RecipeCategory::Smithing,
);

// Create a forge workbench
let mut bench = Workbench::new(1, Vec3::ZERO, WorkbenchType::Forge, WorkbenchTier::Basic);

// Initialise the global economy
let mut economy = Economy::default();

// Set up an auction house
let mut ah = AuctionHouse::new();

Re-exports§

pub use recipes::Recipe;
pub use recipes::RecipeBook;
pub use recipes::RecipeCategory;
pub use recipes::Ingredient;
pub use recipes::CraftResult;
pub use recipes::CraftingCalculator;
pub use recipes::MasterySystem;
pub use recipes::CategoryMastery;
pub use recipes::RecipeDiscovery;
pub use recipes::QualityTier;
pub use workbench::Workbench;
pub use workbench::WorkbenchType;
pub use workbench::WorkbenchTier;
pub use workbench::WorkbenchState;
pub use workbench::CraftingQueue;
pub use workbench::CraftingJob;
pub use workbench::WorkbenchEvent;
pub use workbench::FuelType;
pub use workbench::FuelSystem;
pub use workbench::CraftingStation;
pub use workbench::AutoCrafter;
pub use workbench::AutoCraftConfig;
pub use economy::Economy;
pub use economy::Currency;
pub use economy::PriceModifier;
pub use economy::PlayerReputation;
pub use economy::ShopItem;
pub use economy::ShopInventory;
pub use economy::TradeOffer;
pub use economy::TaxSystem;
pub use market::AuctionHouse;
pub use market::Listing;
pub use market::Bid;
pub use market::MarketHistory;
pub use market::MarketBoard;
pub use market::TradeWindow;
pub use market::MailMessage;

Modules§

economy
market
recipes
workbench

Structs§

CraftOutcome
A resolved crafting outcome with final computed values.
CraftingContext
A single crafting session context bundling all subsystems.

Enums§

CraftingError
Reasons a crafting attempt can fail.

Functions§

category_to_bench_type
Map a RecipeCategory to the WorkbenchType it requires (if any).
validate_craft
Validate whether a crafting attempt can begin given current game state.