2022-12-31 08:38:01 +00:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
use crate::{time::Time, world::Town, generators::PersonNameGenerator};
|
|
|
|
|
2022-12-31 07:54:18 +00:00
|
|
|
pub enum Profession {
|
|
|
|
Peasant,
|
|
|
|
Adventurer,
|
|
|
|
Blacksmith,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Person {
|
|
|
|
pub name: String,
|
2022-12-31 08:38:01 +00:00
|
|
|
pub birth_date: Time,
|
|
|
|
pub birth_location: Rc<Town>,
|
2022-12-31 07:54:18 +00:00
|
|
|
pub profession: Profession,
|
|
|
|
pub location: [usize; 2],
|
2022-12-31 08:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Person {
|
|
|
|
pub fn new(birth_date: Time, birth_location: Rc<Town>, location: [usize; 2]) -> Person {
|
|
|
|
Person {
|
|
|
|
name: PersonNameGenerator::name(),
|
|
|
|
birth_date: birth_date,
|
|
|
|
birth_location: birth_location,
|
|
|
|
profession: Profession::Peasant,
|
|
|
|
location: [0, 0],
|
|
|
|
}
|
|
|
|
}
|
2022-12-31 07:54:18 +00:00
|
|
|
}
|