pub type GalaxyAtWar = Model;Aliased Type§
pub struct GalaxyAtWar {
pub id: u32,
pub player_id: u32,
pub last_modified: NaiveDateTime,
pub group_a: u16,
pub group_b: u16,
pub group_c: u16,
pub group_d: u16,
pub group_e: u16,
}Fields§
§id: u32The unique ID for this galaxy at war data
player_id: u32The ID of the player this galaxy at war data belongs to
last_modified: NaiveDateTimeThe time at which this galaxy at war data was last modified. Used to calculate how many days of decay have passed
group_a: u16The first group value
group_b: u16The second group value
group_c: u16The third group value
group_d: u16The fourth group value
group_e: u16The fifth group value
Implementations§
Source§impl GalaxyAtWar
impl GalaxyAtWar
Sourcepub async fn find_or_create(
db: &DatabaseConnection,
player: &Model,
decay: f32,
) -> DbResult<Self>
pub async fn find_or_create( db: &DatabaseConnection, player: &Model, decay: f32, ) -> DbResult<Self>
Finds or creates a new galaxy at war entry for the provided player. If one exists then the provided decay value will be applied to it.
db The database connection
player The player to search for galaxy at war models for
decay The decay value
Sourcepub async fn increase(
self,
db: &DatabaseConnection,
values: (u16, u16, u16, u16, u16),
) -> DbResult<Model>
pub async fn increase( self, db: &DatabaseConnection, values: (u16, u16, u16, u16, u16), ) -> DbResult<Model>
Increases the group values stored on the provided galaxy at war models by the values provided.
db The database connection
value The galaxy at war model to increase
values The values to increase each group by