gamemstr_common/
monster.rs1use core::fmt;
2
3use serde::{Deserialize, Serialize};
4
5use crate::creature::Creature;
6
7#[derive(Serialize, Deserialize, Debug)]
8pub struct Monster {
9 pub creature: Creature,
10}
11
12impl Monster {
13 pub fn new(creature: Creature) -> Self {
14 Self { creature }
15 }
16}
17
18#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone)]
19pub enum MonsterType {
20 Aberration,
21 Beast,
22 Celestial,
23 Construct,
24 Dragon,
25 Elemental,
26 Fey,
27 Fiend,
28 Giant,
29 Humanoid,
30 Monstrosity,
31 Ooze,
32 Plant,
33 Undead,
34}
35
36impl fmt::Display for MonsterType {
37 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
38 write!(f, "{:?}", self)
39 }
40}