GalaxyAtWar

Type Alias GalaxyAtWar 

Source
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: u32

The unique ID for this galaxy at war data

§player_id: u32

The ID of the player this galaxy at war data belongs to

§last_modified: NaiveDateTime

The time at which this galaxy at war data was last modified. Used to calculate how many days of decay have passed

§group_a: u16

The first group value

§group_b: u16

The second group value

§group_c: u16

The third group value

§group_d: u16

The fourth group value

§group_e: u16

The fifth group value

Implementations§

Source§

impl GalaxyAtWar

Source

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

Source

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