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::{ hash_map, HashMap };
use crate::{ Store, Loader, Cache };
use crate::def::osrs::{
ItemDefinition,
NpcDefinition,
ObjectDefinition,
};
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct ItemLoader {
itms: HashMap<u32, ItemDefinition>
}
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct NpcLoader {
npcs: HashMap<u32, NpcDefinition>
}
#[derive(Clone, Eq, PartialEq, Debug, Default)]
pub struct ObjectLoader {
objs: HashMap<u32, ObjectDefinition>
}
impl_osrs_loader!(ItemLoader, ItemDefinition, itms, index_id: 2, archive_id: 10);
impl_osrs_loader!(NpcLoader, NpcDefinition, npcs, index_id: 2, archive_id: 9);
impl_osrs_loader!(ObjectLoader, ObjectDefinition, objs, index_id: 2, archive_id: 6);