pub struct GroupFormation { /* private fields */ }Expand description
A single formation definition specifying how units should be arranged.
Each formation includes AI usage criteria, unit requirements, and a set of formation blocks that define where different unit types should be positioned.
Implementations§
Source§impl GroupFormation
impl GroupFormation
Sourcepub fn ai_priority(&self) -> &f32
pub fn ai_priority(&self) -> &f32
AI priority value for selecting this formation (higher = more preferred).
Sourcepub fn ai_purpose(&self) -> &AIPurpose
pub fn ai_purpose(&self) -> &AIPurpose
Bitflags indicating when this formation should be used (attack, defend, naval, etc.).
Sourcepub fn min_unit_category_percentage(&self) -> &Vec<MinUnitCategoryPercentage>
pub fn min_unit_category_percentage(&self) -> &Vec<MinUnitCategoryPercentage>
Minimum percentage requirements for unit categories in this formation.
Sourcepub fn ai_supported_subcultures(&self) -> &Vec<String>
pub fn ai_supported_subcultures(&self) -> &Vec<String>
List of supported subcultures (introduced in Rome 2).
If non-empty, this formation is only available to armies from these subcultures.
Sourcepub fn ai_supported_factions(&self) -> &Vec<String>
pub fn ai_supported_factions(&self) -> &Vec<String>
List of supported factions (introduced in Rome 2).
If non-empty, this formation is only available to armies from these factions.
Sourcepub fn group_formation_blocks(&self) -> &Vec<GroupFormationBlock>
pub fn group_formation_blocks(&self) -> &Vec<GroupFormationBlock>
Formation blocks defining unit positions and arrangements.
Source§impl GroupFormation
impl GroupFormation
Sourcepub fn ai_priority_mut(&mut self) -> &mut f32
pub fn ai_priority_mut(&mut self) -> &mut f32
AI priority value for selecting this formation (higher = more preferred).
Sourcepub fn ai_purpose_mut(&mut self) -> &mut AIPurpose
pub fn ai_purpose_mut(&mut self) -> &mut AIPurpose
Bitflags indicating when this formation should be used (attack, defend, naval, etc.).
Sourcepub fn min_unit_category_percentage_mut(
&mut self,
) -> &mut Vec<MinUnitCategoryPercentage>
pub fn min_unit_category_percentage_mut( &mut self, ) -> &mut Vec<MinUnitCategoryPercentage>
Minimum percentage requirements for unit categories in this formation.
Sourcepub fn ai_supported_subcultures_mut(&mut self) -> &mut Vec<String>
pub fn ai_supported_subcultures_mut(&mut self) -> &mut Vec<String>
List of supported subcultures (introduced in Rome 2).
If non-empty, this formation is only available to armies from these subcultures.
Sourcepub fn ai_supported_factions_mut(&mut self) -> &mut Vec<String>
pub fn ai_supported_factions_mut(&mut self) -> &mut Vec<String>
List of supported factions (introduced in Rome 2).
If non-empty, this formation is only available to armies from these factions.
Sourcepub fn group_formation_blocks_mut(&mut self) -> &mut Vec<GroupFormationBlock>
pub fn group_formation_blocks_mut(&mut self) -> &mut Vec<GroupFormationBlock>
Formation blocks defining unit positions and arrangements.
Source§impl GroupFormation
impl GroupFormation
Sourcepub fn set_ai_priority(&mut self, val: f32) -> &mut Self
pub fn set_ai_priority(&mut self, val: f32) -> &mut Self
AI priority value for selecting this formation (higher = more preferred).
Sourcepub fn set_ai_purpose(&mut self, val: AIPurpose) -> &mut Self
pub fn set_ai_purpose(&mut self, val: AIPurpose) -> &mut Self
Bitflags indicating when this formation should be used (attack, defend, naval, etc.).
Sourcepub fn set_min_unit_category_percentage(
&mut self,
val: Vec<MinUnitCategoryPercentage>,
) -> &mut Self
pub fn set_min_unit_category_percentage( &mut self, val: Vec<MinUnitCategoryPercentage>, ) -> &mut Self
Minimum percentage requirements for unit categories in this formation.
Sourcepub fn set_ai_supported_subcultures(&mut self, val: Vec<String>) -> &mut Self
pub fn set_ai_supported_subcultures(&mut self, val: Vec<String>) -> &mut Self
List of supported subcultures (introduced in Rome 2).
If non-empty, this formation is only available to armies from these subcultures.
Sourcepub fn set_ai_supported_factions(&mut self, val: Vec<String>) -> &mut Self
pub fn set_ai_supported_factions(&mut self, val: Vec<String>) -> &mut Self
List of supported factions (introduced in Rome 2).
If non-empty, this formation is only available to armies from these factions.
Sourcepub fn set_group_formation_blocks(
&mut self,
val: Vec<GroupFormationBlock>,
) -> &mut Self
pub fn set_group_formation_blocks( &mut self, val: Vec<GroupFormationBlock>, ) -> &mut Self
Formation blocks defining unit positions and arrangements.
Trait Implementations§
Source§impl Clone for GroupFormation
impl Clone for GroupFormation
Source§fn clone(&self) -> GroupFormation
fn clone(&self) -> GroupFormation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GroupFormation
impl Debug for GroupFormation
Source§impl Default for GroupFormation
impl Default for GroupFormation
Source§fn default() -> GroupFormation
fn default() -> GroupFormation
Source§impl<'de> Deserialize<'de> for GroupFormation
impl<'de> Deserialize<'de> for GroupFormation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for GroupFormation
impl PartialEq for GroupFormation
Source§impl Serialize for GroupFormation
impl Serialize for GroupFormation
impl StructuralPartialEq for GroupFormation
Auto Trait Implementations§
impl Freeze for GroupFormation
impl RefUnwindSafe for GroupFormation
impl Send for GroupFormation
impl Sync for GroupFormation
impl Unpin for GroupFormation
impl UnsafeUnpin for GroupFormation
impl UnwindSafe for GroupFormation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.