wip: checkpoint multi-game core work
This commit is contained in:
@@ -8,18 +8,22 @@ pub struct Profile {
|
||||
pub username: String,
|
||||
pub level: i64,
|
||||
pub xp: i64,
|
||||
/// The game this profile belongs to (e.g. "fifa17", "fifa23"). Scopes all of
|
||||
/// this profile's downstream state so multiple games share one core + DB.
|
||||
pub game_id: String,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
impl Profile {
|
||||
pub fn new(username: impl Into<String>) -> Self {
|
||||
pub fn new(username: impl Into<String>, game_id: impl Into<String>) -> Self {
|
||||
let now = Utc::now();
|
||||
Self {
|
||||
id: Uuid::new_v4().to_string(),
|
||||
username: username.into(),
|
||||
level: 1,
|
||||
xp: 0,
|
||||
game_id: game_id.into(),
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user