forked from Roflin/gamenight
Rewrite to a API trait.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
use std::{collections::HashMap, fmt::Display};
|
||||
|
||||
use crate::domain::game::Game;
|
||||
use crate::domain::location::Location;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct OwnedGames(pub HashMap<String, Vec<Game>>);
|
||||
pub struct OwnedGames (pub HashMap<String, Vec<(Game, Option<Location>)>>);
|
||||
|
||||
impl Display for OwnedGames {
|
||||
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 {
|
||||
for (g, _) in v {
|
||||
write!(f, "\t{}\n", g.name)?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user