Geoffrey-rs/geoffrey_models/src/models/locations/town.rs

24 lines
461 B
Rust

use crate::GeoffreyDatabaseModel;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct Town {
id: Option<u64>,
pub residents: HashSet<u64>,
}
impl GeoffreyDatabaseModel for Town {
fn id(&self) -> Option<u64> {
self.id
}
fn set_id(&mut self, id: u64) {
self.id = Some(id)
}
fn tree() -> String {
"town".to_string()
}
}