tavern_keeper/src/events/found_town.rs

28 lines
696 B
Rust

use crate::{state::Action, site::{Town, Structure, Site}, state::GameState, entity::{Location, Entity}};
pub struct FoundTown{
pub loc: Location,
pub town: Town,
}
impl Action for FoundTown {
fn apply(&self, state: &mut GameState) {
state.world.add_site(
Site{
entity: Entity::new_site(),
loc: self.loc,
structure: Structure::Town(self.town.clone()),
coins: 0,
}
);
//self.loc, ucture::Town(self.town.clone()));
}
fn description(&self) -> String {
format!("{} was founded", self.town.name)
}
fn notable(&self) -> bool {
true
}
}