ProcessorLogic

Struct ProcessorLogic 

Source
pub struct ProcessorLogic { /* private fields */ }

Implementations§

Source§

impl ProcessorLogic

Source

pub const fn new( size: u8, symmetric: bool, build_cost: &'static [(Type, u32)], ) -> Self

Source

pub fn get_state(state: &State) -> &ProcessorState
where Self: Sized,

Source

pub fn get_state_mut(state: &mut State) -> &mut ProcessorState
where Self: Sized,

Trait Implementations§

Source§

impl BlockLogic for ProcessorLogic

Source§

fn get_size(&self) -> u8

mindustry blocks are the same width and height
Source§

fn is_symmetric(&self) -> bool

Source§

fn create_build_cost(&self) -> Option<ItemStorage>

Source§

fn data_from_i32(&self, _: i32, _: GridPos) -> Result<DynData, DataConvertError>

Source§

fn deserialize_state( &self, data: DynData, ) -> Result<Option<State>, DeserializeError>

Source§

fn read( &self, b: &mut Build, buff: &mut DataRead<'_>, ) -> Result<(), DataReadError>

Source§

fn mirror_state(&self, state: &mut State, horizontally: bool, vertically: bool)

Source§

fn rotate_state(&self, state: &mut State, clockwise: bool)

Source§

fn serialize_state(&self, state: &State) -> Result<DynData, SerializeError>

Source§

fn draw( &self, name: &str, state: Option<&State>, context: Option<&RenderingContext>, rot: Rotation, scale: Scale, ) -> Image<Cow, CHANNELS>

Source§

impl Ratios for ProcessorLogic

Source§

fn io(&self, _: Option<&State>, name: &str) -> Io

Auto Trait Implementations§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Join<T, 1, 1, T> for T

Source§

fn join(self, with: T) -> [T; 2]

Join a array and an scalar together. For joining two arrays together, see Couple. Read more
Source§

impl<T, const O: usize> Join<T, 1, O, [T; O]> for T

Source§

fn join(self, with: [T; O]) -> [T; { _ }]

Join a array and an scalar together. For joining two arrays together, see Couple. Read more
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.