Displays available owned games for a GameNight.

This commit is contained in:
2025-07-13 14:29:23 +02:00
parent 0e89bca126
commit 8a48119c80
5 changed files with 96 additions and 4 deletions

View File

@@ -2,4 +2,5 @@ pub mod gamenight;
pub mod user;
pub mod config;
pub mod participants;
pub mod game;
pub mod game;
pub mod owned_games;

View File

@@ -0,0 +1,18 @@
use std::{collections::HashMap, fmt::Display};
use crate::domain::game::Game;
pub struct OwnedGames<'a>(pub &'a HashMap<String, Vec<Game>>);
impl<'a> Display for OwnedGames<'a> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (k,v) in self.0 {
write!(f, "{k}:\n")?;
for g in v {
write!(f, "\t{}\n", g.name)?;
}
}
Ok(())
}
}