[][src]Struct diplomacy::order::Order

pub struct Order<L: Location, C: Command<L>> {
    pub nation: Nation,
    pub region: L,
    pub unit_type: UnitType,
    pub command: C,
}

An order is issued by a nation and gives a command to a unit in a region.

Fields

nation: Nation

The nation to which the commanded unit (or province) belongs.

region: L

The region in which the addressed unit resides (except for build commands).

unit_type: UnitType

The type of unit addressed.

command: C

The command dispatched to the order's region.

Implementations

impl<L: Location, C: Command<L>> Order<L, C>[src]

pub fn new(nation: Nation, unit_type: UnitType, region: L, command: C) -> Self[src]

Create a new order.

pub fn unit_position(&self) -> UnitPosition<&L>[src]

Trait Implementations

impl<L: Clone + Location, C: Clone + Command<L>> Clone for Order<L, C>[src]

impl<L: Location, C: Command<L>> Command<L> for Order<L, C>[src]

impl<L: Location, C: Command<L>> Debug for Order<L, C>[src]

impl<L: Location, C: Command<L>> Display for Order<L, C>[src]

impl<L: Eq + Location, C: Eq + Command<L>> Eq for Order<L, C>[src]

impl<'a, L: Location, C: Command<L>> From<&'a Order<L, C>> for Unit<'a>[src]

impl<'a, L: Location, C: Command<L>> From<&'a Order<L, C>> for UnitPosition<'a, &'a L>[src]

impl<L: Location + FromStr<Err = Error>, C: Command<L> + FromWords<Err = Error>> FromStr for Order<L, C>[src]

type Err = Error

The associated error which can be returned from parsing.

impl<L: Hash + Location, C: Hash + Command<L>> Hash for Order<L, C>[src]

impl<L: Ord + Location, C: Ord + Command<L>> Ord for Order<L, C>[src]

impl<L: PartialEq + Location, C: PartialEq + Command<L>> PartialEq<Order<L, C>> for Order<L, C>[src]

impl<L: Location> PartialEq<Order<L, MainCommand<L>>> for SupportedOrder<L>[src]

impl<L: Location> PartialEq<Order<L, MainCommand<L>>> for ConvoyedMove<L>[src]

impl<L: PartialOrd + Location, C: PartialOrd + Command<L>> PartialOrd<Order<L, C>> for Order<L, C>[src]

impl<L: Location, C: Command<L>> StructuralEq for Order<L, C>[src]

impl<L: Location, C: Command<L>> StructuralPartialEq for Order<L, C>[src]

Auto Trait Implementations

impl<L, C> RefUnwindSafe for Order<L, C> where
    C: RefUnwindSafe,
    L: RefUnwindSafe

impl<L, C> Send for Order<L, C> where
    C: Send,
    L: Send

impl<L, C> Sync for Order<L, C> where
    C: Sync,
    L: Sync

impl<L, C> Unpin for Order<L, C> where
    C: Unpin,
    L: Unpin

impl<L, C> UnwindSafe for Order<L, C> where
    C: UnwindSafe,
    L: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.