20 lines
421 B
Rust
20 lines
421 B
Rust
use crate::{entity::EntityId, item::Item, state::{Action, GameState, self}};
|
|
|
|
pub struct ItemCrafted {
|
|
pub crafter: EntityId,
|
|
pub item: Item,
|
|
}
|
|
|
|
impl Action for ItemCrafted {
|
|
fn apply(&self, state: &mut GameState) {
|
|
state.add_item(self.item.clone());
|
|
}
|
|
|
|
fn description(&self) -> String {
|
|
format!("{} crafted", self.item.name)
|
|
}
|
|
|
|
fn notable(&self) -> bool {
|
|
true
|
|
}
|
|
} |