Stpsyr

Struct Stpsyr 

Source
pub struct Stpsyr {
    pub map: Vec<MapRegion>,
    pub orders: Vec<Order>,
    pub retreats: Vec<Retreat>,
    pub adjusts: Vec<Adjust>,
    pub dependencies: Vec<usize>,
    pub dislodged: Vec<(Province, Unit)>,
    pub contested: HashSet<Province>,
    pub phase: Phase,
    pub year: i32,
}

Fields§

§map: Vec<MapRegion>§orders: Vec<Order>§retreats: Vec<Retreat>§adjusts: Vec<Adjust>§dependencies: Vec<usize>§dislodged: Vec<(Province, Unit)>§contested: HashSet<Province>§phase: Phase§year: i32

Implementations§

Source§

impl Stpsyr

Source

pub fn apply_resolved(&mut self)

Source

pub fn resolve(&mut self, id: usize) -> bool

Source§

impl Stpsyr

Source

pub fn add_adjust( &mut self, owner: Power, province: Province, action: AdjustAction, )

Source

pub fn apply_adjusts(&mut self)

Source§

impl Stpsyr

Source

pub fn add_order(&mut self, owner: Power, province: Province, action: Action)

Source

pub fn apply_orders(&mut self)

Source§

impl Stpsyr

Source

pub fn parse(&mut self, power: &Power, orders: String)

Source

pub fn apply(&mut self)

Source§

impl Stpsyr

Source

pub fn add_retreat( &mut self, owner: Power, province: Province, action: RetreatAction, )

Source

pub fn apply_retreats(&mut self)

Source§

impl Stpsyr

Source

pub fn render_svg(&self, path: String) -> Result<()>

Source§

impl Stpsyr

Source

pub fn get_unit(&self, province: &Province) -> Option<Unit>

Source

pub fn get_region(&self, province: &Province) -> Option<&MapRegion>

Source

pub fn sc_counts(&self) -> HashMap<Power, u32>

Source

pub fn unit_counts(&self) -> HashMap<Power, u32>

Source

pub fn next_phase(&mut self)

Source§

impl Stpsyr

Source

pub fn new(mapfile: &'static str) -> Stpsyr

Auto Trait Implementations§

§

impl Freeze for Stpsyr

§

impl RefUnwindSafe for Stpsyr

§

impl Send for Stpsyr

§

impl Sync for Stpsyr

§

impl Unpin for Stpsyr

§

impl UnwindSafe for Stpsyr

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.