23 lines
546 B
Rust
23 lines
546 B
Rust
use std::rc::Rc;
|
|
|
|
use crate::{state::{GameState, Action}, world::{Structure, Tavern}, entity::Location};
|
|
|
|
pub struct TavernBuilt {
|
|
pub loc: Location,
|
|
pub tavern: Rc<Tavern>,
|
|
}
|
|
|
|
impl Action for TavernBuilt {
|
|
fn apply(&self, state: &mut GameState) {
|
|
state.world.add_structure(self.loc, Structure::Tavern(self.tavern.clone()));
|
|
state.set_tavern(self.tavern.clone());
|
|
}
|
|
|
|
fn description(&self) -> String {
|
|
format!("{} was built", self.tavern.name)
|
|
}
|
|
|
|
fn notable(&self) -> bool {
|
|
true
|
|
}
|
|
} |