Trait oc2_hlapi::device::InventoryOperationsInterface

source ·
pub trait InventoryOperationsInterface: RpcDevice {
    // Required methods
    fn move_item(&self, from: i32, into: i32, count: i32) -> Result<()>
       where (): DeserializeOwned + 'static;
    fn drop_item(&self, count: i32, side: Direction) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn drop_item_into(
        &self,
        into: i32,
        count: i32,
        side: Direction,
    ) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn take_item(&self, count: i32, side: Direction) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn take_item_from(
        &self,
        from: i32,
        count: i32,
        side: Direction,
    ) -> Result<i32>
       where i32: DeserializeOwned + 'static;
}
Expand description

An interface between devices which carry out robot inventory operations and the HLAPI

Required Methods§

source

fn move_item(&self, from: i32, into: i32, count: i32) -> Result<()>
where (): DeserializeOwned + 'static,

Attempts to move the given number of items from one robot inventory slot into another slot.

source

fn drop_item(&self, count: i32, side: Direction) -> Result<i32>
where i32: DeserializeOwned + 'static,

Attempts to drop the given number of items in the currently active slot into either the world or an adjacent inventory on the given side. Returns the amount of items dropped

source

fn drop_item_into(&self, into: i32, count: i32, side: Direction) -> Result<i32>
where i32: DeserializeOwned + 'static,

Attempts to drop the given number of items in the currently active slot into the given slot in the adjacent inventory in the given direction. Returns the amount of items dropped.

source

fn take_item(&self, count: i32, side: Direction) -> Result<i32>
where i32: DeserializeOwned + 'static,

Attempts to take the given number of items from either the world or an adjacent inventory on the given side. Returns the amount of items taken.

source

fn take_item_from(&self, from: i32, count: i32, side: Direction) -> Result<i32>
where i32: DeserializeOwned + 'static,

Attempts to take the given number of items from the given slot in the adjacent inventory in the given direction. Returns the amount of items taken.

Object Safety§

This trait is not object safe.

Implementors§