TargetAllow

Struct TargetAllow 

Source
pub struct TargetAllow { /* private fields */ }
Expand description

A struct to specifies how a bullet object should interact with other game objects or units based on their relationship.

Implementations§

Source§

impl TargetAllow

Source

pub fn set_terrain_allowed(&mut self, val: bool)

Sets whether the bullet object can collide with terrain.

Source

pub fn is_terrain_allowed(&self) -> bool

Gets whether the bullet object can collide with terrain.

Source

pub fn allow(&mut self, relation: Relation, allow: bool)

Allows or disallows the bullet object to interact with a game object or unit, based on their relationship.

§Arguments
  • relation - The relationship between the bullet object and the other game object or unit.
  • allow - Whether the bullet object should be allowed to interact.
Source

pub fn is_allow(&mut self, relation: Relation) -> bool

Determines whether the bullet object is allowed to interact with a game object or unit, based on their relationship.

§Arguments
  • relation - The relationship between the bullet object and the other game object or unit.
§Returns
  • bool - Whether the bullet object is allowed to interact.
Source

pub fn to_value(&mut self) -> i32

Converts the object to a value that can be used for interaction settings.

§Returns
  • usize - The value that can be used for interaction settings.
Source

pub fn new() -> TargetAllow

Creates a new TargetAllow object with default settings.

Source

pub fn with_value(value: i32) -> TargetAllow

Creates a new TargetAllow object with the specified value.

§Arguments
  • value - The value to use for the new TargetAllow object.

Trait Implementations§

Source§

impl Drop for TargetAllow

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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, 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.