Skip to main content

TechRecipe

Struct TechRecipe 

Source
pub struct TechRecipe<T: Technology> { /* private fields */ }
Expand description

A recipe for producing research points for specific technologies.

Trait Implementations§

Source§

impl<T: Debug + Technology> Debug for TechRecipe<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Recipe for TechRecipe<T>
where T: Technology,

Source§

const TIME: u64 = T::POINT_RECIPE_TIME

Amount of ticks one cycle of the recipe takes to complete.
Source§

const INPUT_AMOUNTS: Self::InputAmountsType = T::INPUT_AMOUNTS

Amount for each of the input resource types, per recipe cycle.
Source§

const OUTPUT_AMOUNTS: (u32,)

Amount for each of the output resource types, per recipe cycle.
Source§

type Inputs = <T as TechnologyEx>::Inputs

Typically a tuple of multiple RecipeTypes, to define the inputs for one cycle of the recipe.
Source§

type InputAmountsType = <T as TechnologyEx>::InputAmountsType

The type for Self::InputAmountsType, which is used to allow users to access the input amount for each of the input resource types, per recipe cycle.
Source§

type Outputs = (Resource<ResearchPoint<T>>,)

Typically a tuple of multiple RecipeTypes, to define the outputs for one cycle of the recipe.
Source§

type OutputAmountsType = (u32,)

The type for Self::OuptutAmountsType, which is used to allow users to access the output amount for each of the output resource types, per recipe cycle.
Source§

fn new_inputs() -> Self::Inputs

Factory function to create a new Self::Inputs with zero resources.
Source§

fn new_outputs() -> Self::Outputs

Factory function to create a new Self::Outputs with zero resources.

Auto Trait Implementations§

§

impl<T> Freeze for TechRecipe<T>

§

impl<T> RefUnwindSafe for TechRecipe<T>
where T: RefUnwindSafe,

§

impl<T> Send for TechRecipe<T>
where T: Send,

§

impl<T> Sync for TechRecipe<T>
where T: Sync,

§

impl<T> Unpin for TechRecipe<T>
where T: Unpin,

§

impl<T> UnwindSafe for TechRecipe<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.