use std::{rc::Rc, fmt::Display}; use crate::{time::Time, world::Town, generators::PersonNameGenerator}; pub enum Profession { Peasant, Adventurer, Blacksmith, } pub struct Person { pub name: String, pub birth_date: Time, pub birth_location: Rc, pub profession: Profession, pub location: [usize; 2], } impl Person { pub fn new(birth_date: Time, birth_location: Rc, location: [usize; 2]) -> Person { Person { name: PersonNameGenerator::name(), birth_date: birth_date, birth_location: birth_location, profession: Profession::Peasant, location: [0, 0], } } } impl Display for Person { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.name) } }