ResourceType

Trait ResourceType 

Source
pub trait ResourceType: Sealed + Debug {
    const NAME: &'static str;
}
Expand description

A type that represents a specific kind of resource in the game. Implementors of this trait represent different resource types, such as iron, copper, or science packs. Only useful as a type parameter; has no associated methods.

§Modding

To define a new resource type, use the resource_type! macro.

Required Associated Constants§

Source

const NAME: &'static str

A human readable name for this resource type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ResourceType for RedScience

Source§

const NAME: &'static str = "RedScience"

Source§

impl ResourceType for Copper

Source§

const NAME: &'static str = "Copper"

Source§

impl ResourceType for CopperOre

Source§

const NAME: &'static str = "CopperOre"

Source§

impl ResourceType for CopperWire

Source§

const NAME: &'static str = "CopperWire"

Source§

impl ResourceType for ElectronicCircuit

Source§

const NAME: &'static str = "ElectronicCircuit"

Source§

impl ResourceType for Iron

Source§

const NAME: &'static str = "Iron"

Source§

impl ResourceType for IronOre

Source§

const NAME: &'static str = "IronOre"

Source§

impl ResourceType for Point

Source§

const NAME: &'static str = "Point"

Source§

impl ResourceType for Steel

Source§

const NAME: &'static str = "Steel"

Source§

impl<T> ResourceType for ResearchPoint<T>
where T: Technology,

Source§

const NAME: &'static str = T::NAME