1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use std::collections::HashMap;
use crate::{ Store, Loader, util, Cache };
use crate::def::osrs::{
ItemDefinition,
NpcDefinition,
ObjectDefinition
};
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct ItemLoader {
pub items: HashMap<u16, ItemDefinition>
}
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct NpcLoader {
pub npcs: HashMap<u16, NpcDefinition>
}
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct ObjectLoader {
pub objs: HashMap<u16, ObjectDefinition>
}
impl_loader!(ItemLoader, ItemDefinition, items, archive_id: 10);
impl_loader!(NpcLoader, NpcDefinition, npcs, archive_id: 9);
impl_loader!(ObjectLoader, ObjectDefinition, objs, archive_id: 6);