29 lines
708 B
Rust
29 lines
708 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{
|
|
loc: self.loc,
|
|
id: 0,
|
|
},
|
|
structure: Structure::Town(self.town.clone()),
|
|
}
|
|
);
|
|
//self.loc, ucture::Town(self.town.clone()));
|
|
}
|
|
|
|
fn description(&self) -> String {
|
|
format!("{} was founded", self.town.name)
|
|
}
|
|
|
|
fn notable(&self) -> bool {
|
|
true
|
|
}
|
|
} |