[][src]Struct diplomacy::judge::ResolverContext

pub struct ResolverContext<'a> {
    pub world_map: &'a Map,
    // some fields omitted
}

The immutable inputs for a resolution equation.

Fields

world_map: &'a Map

The map against which orders were issued.

Implementations

impl<'a> ResolverContext<'a>[src]

pub fn new(world_map: &'a Map, orders: Vec<MappedMainOrder>) -> Self[src]

Creates a new resolver context for a set of orders on a map.

pub fn orders(&self) -> &[MappedMainOrder][src]

Get a view of the orders in the order they were submitted.

pub fn resolve_using<A: Adjudicate>(&'a self, rules: A) -> Outcome<'a, A>[src]

Resolve the context using the provided adjudicator.

The adjudicator is responsible for rule questions, while the resolver is responsible for tracking whether orders are successful. The two are interdependent, calling back and forth as they work towards a solution.

pub fn resolve(&'a self) -> Outcome<'a, Rulebook>[src]

Resolve the orders in the context using the standard rulebook

pub fn find_order_to_province(
    &'a self,
    p: &ProvinceKey
) -> Option<&'a MappedMainOrder>
[src]

pub fn find_order_to_region(
    &'a self,
    r: &RegionKey
) -> Option<&'a MappedMainOrder>
[src]

Trait Implementations

impl<'a> Clone for ResolverContext<'a>[src]

impl<'a> Debug for ResolverContext<'a>[src]

impl<'a> Eq for ResolverContext<'a>[src]

impl<'a> From<ResolverContext<'a>> for HashMap<MappedMainOrder, OrderState>[src]

impl<'a> PartialEq<ResolverContext<'a>> for ResolverContext<'a>[src]

impl<'a> StructuralEq for ResolverContext<'a>[src]

impl<'a> StructuralPartialEq for ResolverContext<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ResolverContext<'a>

impl<'a> Send for ResolverContext<'a>

impl<'a> Sync for ResolverContext<'a>

impl<'a> Unpin for ResolverContext<'a>

impl<'a> UnwindSafe for ResolverContext<'a>

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