Skip to main content

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<T: Technology> ResourceType for ResearchPoint<T>

Source§

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