tavern_keeper/src/events/found_town.rs

22 lines
489 B
Rust

use std::rc::Rc;
use crate::{state::Action, world::{Town, Structure}, state::GameState, entity::Location};
pub struct FoundTown{
pub loc: Location,
pub town: Rc<Town>,
}
impl Action for FoundTown {
fn apply(&self, state: &mut GameState) {
state.world.add_structure(self.loc, Structure::Town(self.town.clone()));
}
fn description(&self) -> String {
format!("{} was founded", self.town.name)
}
fn notable(&self) -> bool {
true
}
}