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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use crate::players::PlayerID;
use crate::{prelude::*, CanFrom};
use crate::{Structure, StructureID};
use js_sys::Object;
use std::convert::TryFrom;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = StructureID, typescript_type = "OutpostID")]
#[derive(Clone, Debug, PartialEq, Eq)]
pub type OutpostID;
#[wasm_bindgen(extends = Structure, typescript_type = "Outpost")]
#[derive(Clone, Debug, PartialEq, Eq)]
pub type Outpost;
#[wasm_bindgen(method, getter)]
pub fn id(this: &Outpost) -> OutpostID;
#[wasm_bindgen(method, getter)]
pub fn range(this: &Outpost) -> f64;
#[wasm_bindgen(method, getter)]
pub fn sight(this: &Outpost) -> OutpostSight;
#[wasm_bindgen(method, getter)]
pub fn control(this: &Outpost) -> PlayerID;
}
impl CanFrom<Structure> for Outpost {
#[inline]
fn can_from(value: &Structure) -> bool {
value.structure_type().to_str() == "outpost"
}
}
try_can_from!(impl TryFrom<Structure>, Error = Structure for Outpost);
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = Object, typescript_type = "(typeof outposts)")]
#[derive(Clone, Debug)]
pub type Outposts;
#[wasm_bindgen]
pub static outposts: Outposts;
}
impl TryGetByID<EntityID, Outpost> for Outposts {}
impl TryGetByID<StructureID, Outpost> for Outposts {}
impl GetByID<OutpostID, Outpost> for Outposts {}
impl EnumerateByID<OutpostID, Outpost> for Outposts {}
#[wasm_bindgen(js_name = "outpost_mdo")]
extern "C" {
#[wasm_bindgen]
pub static outpost_mdo: Outpost;
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen]
pub static outpost: Outpost;
}