blue_archive 0.5.2

A Blue Archive api wrapper for Rust, based off of SchaleDB's data: https://github.com/lonqie/SchaleDB
Documentation
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
//! Contains useful public enums to be used when working with the API wrapper.

use strum_macros::{Display, EnumIter, EnumString};

/// Languages that **``SchaleDB``** supports.
#[derive(Debug, Display, Clone, Copy)]
pub enum Language {
    English,
    Chinese,
    Japanese,
    Korean,
    Thai,
    Taiwanese,
}

impl Language {
    /// The identifier of the Language, e.g. (en, tw, kr)
    pub fn id(&self) -> String {
        match self {
            Self::English => "en",
            Self::Chinese => "cn",
            Self::Japanese => "jp",
            Self::Korean => "kr",
            Self::Thai => "th",
            Self::Taiwanese => "tw",
        }
        .to_string()
    }
}

/**

    **This is a `enum` that contains the current Blue Archive schools represented in the data.**

    This is the current list of schools represented in the data.
    * **Abydos** High School
    * **Gehenna** Academy
    * **Hyakkiyako** Alliance Academy
    * **Millennium** Science School
    * **Shanhaijing** Senior Secondary School
    * **Trinity** General School
    * **Red Winter** Federal Academy
    * **Valkyrie** Police Academy
    * **Arius** Branch School
    * **SRT** Special Academy

    In the case that a school in the data is not present on the wrapper,
    a [`School::Unknown(String)`] is returned to represent the unknown school with its name in the `enum`.
*/
#[derive(EnumString, Debug, Display, EnumIter, PartialEq, Eq)]
pub enum School {
    /// **Abydos** High School
    Abydos,
    /// **Gehenna** Academy
    Gehenna,
    /// **Hyakkiyako** Alliance Academy
    Hyakkiyako,
    /// **Millennium** Science School
    Millennium,
    /// **Shanhaijing** Senior Secondary School
    Shanhaijing,
    /// **Trinity** General School
    Trinity,
    /// **Red Winter** Federal Academy
    RedWinter,
    /// **Valkyrie** Police Academy
    Valkyrie,
    /// **Arius** Branch School
    Arius,
    /// **SRT** Special Academy
    SRT,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

impl School {
    /// The full name of the school.
    pub fn full_name(&self) -> String {
        match self {
            Self::Abydos => "Abydos High School",
            Self::Gehenna => "Gehenna Academy",
            Self::Hyakkiyako => "Hyakkiyako Alliance Academy",
            Self::Millennium => "Millennium Science School",
            Self::Shanhaijing => "Shanhaijing Senior Secondary School",
            Self::Trinity => "Trinity General School",
            Self::RedWinter => "Red Winter Federal Academy",
            Self::Valkyrie => "Valkyrie Police Academy",
            Self::Arius => "Arius Branch School",
            Self::SRT => "SRT Special Academy",
            Self::Unknown(string) => string.as_ref(),
        }
        .to_string()
    }
}

/**

    **This is a `enum` that contains the current Blue Archive tactical roles represented in the data.**

    This is the list of current tactical roles represented in the data.
    - **Tanker**
    - **Vehicle**
    - **DamageDealer**
    - **Healer**
    - **Supporter**

    In the case that a tactical role in the data is not present on the wrapper,
    a [`TacticalRole::Unknown(String)`] is returned to represent the unknown tactical role with its name in the `enum`.
*/
#[derive(Debug, Display, EnumString, EnumIter, PartialEq, Eq)]
pub enum TacticalRole {
    Tanker,
    Vehicle,
    #[strum(serialize = "DamageDealer", to_string = "Damage Dealer")]
    DamageDealer,
    Healer,
    Supporter,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

/**

    **This is a `enum` that contains the current Blue Archive squads represented in the data.**

    This is the current list of squads represented in the data.
    * **Main** (aka. Striker)
    * **Support** (aka. Special)

    In the case that a squad in the data is not present on the wrapper,
    a [`Squad::Unknown(String)`] is returned to represent the unknown type with its name in the `enum`.
*/
#[derive(Debug, Display, EnumString, EnumIter, PartialEq, Eq)]
pub enum Squad {
    Main,
    Support,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

impl Squad {
    /// Obtains an alternative name for the squad that some may be familiar with.
    ///
    /// - **Main** -> Striker
    /// - **Support** -> Special
    ///
    /// Although, if [``Squad::Unknown``], the inner value will just be returned.
    pub fn alt_name(&self) -> String {
        match self {
            Self::Main => "Striker".to_string(),
            Self::Support => "Special".to_string(),
            Self::Unknown(squad) => squad.to_string(),
        }
    }
}

/**

    **This is a `enum` that contains the current Blue Archive armor represented in the data.**

    This is the current list of armor represented in the data.
    * **Unarmed**
    * **ElasticArmor**
    * **HeavyArmor**
    * **LightArmor**

    In the case that a armor in the data is not present on the wrapper,
    a [`Armor::Unknown(String)`] is returned to represent the unknown armor with its name in the `enum`.
*/
#[derive(Debug, Display, EnumString, EnumIter, PartialEq, Eq)]
pub enum Armor {
    Unarmed,
    #[strum(serialize = "ElasticArmor", to_string = "Elastic Armor")]
    ElasticArmor,
    #[strum(serialize = "HeavyArmor", to_string = "Heavy Armor")]
    HeavyArmor,
    #[strum(serialize = "LightArmor", to_string = "Light Armor")]
    LightArmor,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

/**

    **This is a `enum` that contains the current Blue Archive positions represented in the data.**

    This is the current list of positions represented in the data.
    * **Front**
    * **Middle**
    * **Back**

    In the case that a position in the data is not present on the wrapper,
    a [`Position::Unknown(String)`] is returned to represent the unknown position with its name in the `enum`.
*/
#[derive(Debug, Display, EnumString, EnumIter, PartialEq, Eq)]
pub enum Position {
    Front,
    Middle,
    Back,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

/**

    **This is a `enum` that contains the current Blue Archive bullet types represented in the data.**

    This is the current list of bullet types represented in the data.
    * **Explosion**
    * **Mystic**
    * **Piercing**

    In the case that a bullet type in the data is not present on the wrapper,
    a [`BulletType::Unknown(String)`] is returned to represent the unknown bullet type with its name in the `enum`.
*/
#[derive(Debug, Display, EnumString, EnumIter, PartialEq, Eq)]
pub enum BulletType {
    Explosion,
    Mystic,
    #[strum(serialize = "Pierce")]
    Piercing,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

/**

    **This is a `enum` that contains the current Blue Archive clubs represented in the data.**

    This is the current list of clubs represented in the data.
    - **Problem Solver 68**
    - **Super Phenomenon Task Force**
    - **Gourmet Research Society**
    - **Make Up Work Club**
    - **Prefect Team**
    - **Foreclosure Task Force**
    - **Veritas**
    - **Cleaning & Clearing**
    - **Plum Blossom Garden**
    - **Athletics Training Club**
    - **Ninjutsu Research Department**
    - **Justice Task Force**
    - **Game Development Department**
    - **Red Winter Secretary**
    - **After School Sweets Club**
    - **Unassigned**
    - **Inner Discipline Club**
    - **Library Committee**
    - **Sisterhood**
    - **RABBIT Squad**
    - **Arius Squad**
    - **Yin-Yang Club**
    - **Seminar**
    - **Public Safety Bureau**
    - **Engineering Club**
    - **Trinity Vigilante Crew**
    - **Festival Operations Department**
    - **Chinese Alchemy Study Club**
    - **Spec Ops #227**
    - **Medical Emergency Club**
    - **Pandemonium Society**
    - **School Lunch Club**
    - **Remedial Knights**

    In the case that a club in the data is not present on the wrapper,
    a [`Club::Unknown(String)`] is returned to represent the unknown club with its name in the `enum`.
*/
#[derive(Debug, Hash, Eq, PartialEq, EnumIter, EnumString, Display)]
pub enum Club {
    #[strum(serialize = "Kohshinjo68", to_string = "Problem Solver 68")]
    ProblemSolver68,
    #[strum(serialize = "SPTF", to_string = "Super Phenomenon Task Force")]
    SuperPhenomenonTaskForce,
    #[strum(serialize = "GourmetClub", to_string = "Gourmet Research Society")]
    GourmetResearchSociety,
    #[strum(serialize = "RemedialClass", to_string = "Make-Up Work Club")]
    MakeUpWorkClub,
    #[strum(serialize = "Fuuki", to_string = "Prefect Team")]
    PrefectTeam,
    #[strum(serialize = "Countermeasure", to_string = "Foreclosure Task Force")]
    ForeclosureTaskForce,
    Veritas,
    #[strum(serialize = "CleanNClearing", to_string = "Cleaning & Clearing")]
    CleaningAndClearing,
    #[strum(serialize = "Meihuayuan", to_string = "Plum Blossom Garden")]
    PlumBlossomGarden,
    #[strum(serialize = "TrainingClub", to_string = "Athletics Training Club")]
    AthleticsTrainingClub,
    #[strum(serialize = "NinpoKenkyubu", to_string = "Ninjutsu Research Club")]
    NinjutsuResearchClub,
    #[strum(serialize = "Justice", to_string = "Justice Task Force")]
    JusticeTaskForce,
    #[strum(serialize = "GameDev", to_string = "Game Development Club")]
    GameDevelopmentClub,
    #[strum(serialize = "RedwinterSecretary", to_string = "Red Winter Office")]
    RedWinterSecretary,
    #[strum(serialize = "HoukagoDessert", to_string = "After-School Sweets Club")]
    AfterSchoolSweetsClub,
    #[strum(serialize = "EmptyClub", to_string = "Unassigned")]
    Unassigned,
    #[strum(serialize = "Shugyobu", to_string = "Inner Discipline Club")]
    InnerDisciplineClub,
    #[strum(serialize = "BookClub", to_string = "Library Committee")]
    LibraryCommittee,
    #[strum(serialize = "SisterHood", to_string = "Sisterhood")]
    Sisterhood,
    #[strum(serialize = "RabbitPlatoon", to_string = "RABBIT Squad")]
    RABBITSquad,
    #[strum(serialize = "AriusSqud", to_string = "Arius Squad")]
    AriusSquad,
    #[strum(serialize = "Onmyobu", to_string = "Yin-Yang Club")]
    YinYangClub,
    #[strum(serialize = "TheSeminar", to_string = "Seminar")]
    Seminar,
    #[strum(serialize = "anzenkyoku", to_string = "Public Safety Bureau")]
    PublicSafetyBureau,
    #[strum(serialize = "PublicPeaceBureau", to_string = "Public Peace Bureau")]
    PublicPeaceBureau,
    #[strum(serialize = "Engineer", to_string = "Engineering Club")]
    EngineeringClub,
    #[strum(serialize = "TrinityVigilance", to_string = "Trinity Vigilante Crew")]
    TrinityVigilanteCrew,
    #[strum(
        serialize = "MatsuriOffice",
        to_string = "Festival Operations Department"
    )]
    FestivalOperationsDepartment,
    #[strum(serialize = "Endanbou", to_string = "Chinese Alchemy Study Club")]
    ChineseAlchemyStudyClub,
    #[strum(serialize = "Class227", to_string = "Spec Ops #227")]
    SpecOpsNumber227,
    #[strum(serialize = "Emergentology", to_string = "Medical Emergency Club")]
    MedicalEmergencyClub,
    #[strum(serialize = "FoodService", to_string = "School Lunch Club")]
    SchoolLunchClub,
    #[strum(serialize = "PandemoniumSociety", to_string = "Pandemonium Society")]
    PandemoniumSociety,
    #[strum(serialize = "KnightsHospitaller", to_string = "Remedial Knights")]
    RemedialKnights,
    #[strum(serialize = "TeaParty", to_string = "Tea Party")]
    TeaParty,
    #[strum(serialize = "HotSpringsDepartment", to_string = "Hot Spring Club")]
    HotSpringsClub,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

/**

    **This is a `enum` that contains the current Blue Archive weapon types represented in the data.**

    This is the current list of weapon types represented in the data.
    * **AR** (Assault Rifle)
    * **GL** (Grenade Launcher)
    * **FT** (Flamethrower)
    * **HG** (Handgun)
    * **MG** (Machine Gun)
    * **MT** (Mortar)
    * **RG** (Railgun)
    * **RL** (Rocket Launcher)
    * **SG** (Shotgun)
    * **SMG** (Submachine Gun)
    * **SR** (Sniper RIfle)
    * **Cannon**
    * **None**

    In the case that a weapon type in the data is not present on the wrapper,
    a [`WeaponType::Unknown(String)`] is returned to represent the unknown weapon type with its name in the `enum`.
*/
#[derive(Debug, EnumString, Display, EnumIter, PartialEq, Eq)]
pub enum WeaponType {
    /// **`Assault Rifle`**
    AR,
    /// **`Flamethrower`**
    FT,
    /// **`Sniper Rifle`**
    SR,
    /// **`Machine Gun`**
    MG,
    /// **`Mortar`**
    MT,
    /// **`Handgun`**
    HG,
    /// **`Submachine Gun`**
    SMG,
    /// **`Rocket Launcher`**
    RL,
    /// **`Shotgun`**
    SG,
    /// **`Grenade Launcher`**
    GL,
    /// **`Railgun`**
    RG,
    /// **`Cannon`**
    Cannon,
    /// **`None`**
    None,
    /// An **`unknown`** type that contains the inner value.
    Unknown(String),
}

impl WeaponType {
    /// The full name of the weapon.
    pub fn full_name(&self) -> String {
        match self {
            Self::AR => "Assault Rifle",
            Self::GL => "Grenade Launcher",
            Self::FT => "Flamethrower",
            Self::HG => "Handgun",
            Self::MG => "Machine Gun",
            Self::MT => "Mortar",
            Self::RG => "Railgun",
            Self::RL => "Rocket Launcher",
            Self::SG => "Shotgun",
            Self::SMG => "Submachine Gun",
            Self::SR => "Sniper Rifle",
            Self::Cannon => "Cannon",
            Self::None => "No Weapon",
            Self::Unknown(string) => string,
        }
        .to_string()
    }
}