1"""Models for the Creature, Creature Family and Creature Type APIs."""
2
3from wow.models._common import Document, IdRef, LocalizedString, Model, Ref
4
5__all__ = [
6 "Creature",
7 "CreatureFamily",
8 "CreatureFamilyIndex",
9 "CreatureSearchData",
10 "CreatureType",
11 "CreatureTypeIndex",
12]
13
14
[docs]
15class CreatureFamilyIndex(Document):
16 """Every creature family, such as Bat or Wolf."""
17
18 creature_families: tuple[Ref, ...]
19
20
[docs]
21class CreatureFamily(Document):
22 """A creature family: the pet family icon shared by related beasts. A few families have no icon."""
23
24 id: int
25 name: str
26 media: IdRef | None = None
27
28
[docs]
29class CreatureTypeIndex(Document):
30 """Every creature type, such as Beast or Dragonkin."""
31
32 creature_types: tuple[Ref, ...]
33
34
[docs]
35class CreatureType(Document):
36 """A creature type."""
37
38 id: int
39 name: str
40
41
42class _CreatureSearchIdOnly(Model):
43 """A creature display reference stripped down to its id, as search results carry it."""
44
45 id: int
46
47
48class _CreatureSearchLocalizedRef(Model):
49 """An id and localized name, as search results carry nested type and family refs."""
50
51 id: int
52 name: LocalizedString
53
54
[docs]
55class Creature(Document):
56 """A creature, Forest Spider included."""
57
58 id: int
59 name: str
60 type: Ref
61 is_tameable: bool
62 family: Ref | None = None
63 creature_displays: tuple[IdRef, ...] = ()
64
65
[docs]
66class CreatureSearchData(Model):
67 """One creature as indexed for search: every locale's name at once, no ``_links``."""
68
69 id: int
70 name: LocalizedString
71 type: _CreatureSearchLocalizedRef
72 is_tameable: bool
73 family: _CreatureSearchLocalizedRef | None = None
74 creature_displays: tuple[_CreatureSearchIdOnly, ...] = ()