Expand description
§Resource Module
This module defines the resources that can be generated and combined in the game. It provides a framework for creating basic and complex resources, and for defining the recipes that govern their creation.
§Resources
Resources are defined by the Resource trait, which provides a common interface for all
resources. There are two types of resources:
- Basic Resources: These are the simplest resources, and can be generated with
just an
EnergyCell. Examples includeOxygenandHydrogen. - Complex Resources: These are created by combining other resources and an energy cell.
Examples include
WaterandDiamond.
§Generator and Combinator
The Generator and Combinator structs are used to manage the recipes for
creating resources. The Generator is responsible for creating basic resources,
while the Combinator is responsible for creating complex resources.
Each planet has its own Generator and Combinator, which are initialized with
the recipes that are available to that planet.
Structs§
- AIPartner
- A complex resource.
- Carbon
- A basic resource.
- Combinator
- Manages the recipes and production of complex resources for a planet.
- Diamond
- A complex resource.
- Dolphin
- A complex resource.
- Generator
- Manages the recipes and production of basic resources for a planet.
- Hydrogen
- A basic resource.
- Life
- A complex resource.
- Oxygen
- A basic resource.
- Robot
- A complex resource.
- Silicon
- A basic resource.
- Water
- A complex resource.
Enums§
- Basic
Resource - An enum that provides a unified type for all possible basic resources.
- Basic
Resource Type - An enum that identifies a
BasicResourcetype without actually containing the underlying resource. - Complex
Resource - An enum that provides a unified type for all possible complex resources.
- Complex
Resource Request - An enum that represents a structured request to produce a specific complex resource.
- Complex
Resource Type - An enum that identifies a
ComplexResourcetype without actually containing the underlying resource. - Generic
Resource - An enum that contains a resource, which can be either a
BasicResourceor aComplexResource. - Resource
Type - An enum that identifies a resource, which can be either a
BasicResourceTypeor aComplexResourceType, without actually containing the underlying resource.
Traits§
- Resource
- A trait that provides a common interface for all resources.