@wfcd/profile-parser 1.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/package.json +33 -31
  2. package/src/{Ability.js → Ability.ts} +11 -4
  3. package/src/{ArchonCrystal.js → ArchonCrystal.ts} +12 -5
  4. package/src/{ChallengeProgress.js → ChallengeProgress.ts} +11 -4
  5. package/src/Enemy.ts +55 -0
  6. package/src/Intrinsics.ts +98 -0
  7. package/src/ItemConfig.ts +71 -0
  8. package/src/LoadOutInventory.ts +69 -0
  9. package/src/LoadOutItem.ts +194 -0
  10. package/src/LoadOutPreset.ts +122 -0
  11. package/src/Mission.ts +75 -0
  12. package/src/OperatorLoadOuts.ts +108 -0
  13. package/src/Polarity.ts +31 -0
  14. package/src/Profile.ts +308 -0
  15. package/src/ProfileParser.ts +66 -0
  16. package/src/Pvp.ts +43 -0
  17. package/src/Race.ts +36 -0
  18. package/src/Scan.ts +30 -0
  19. package/src/{Skin.js → Skin.ts} +14 -6
  20. package/src/Stats.ts +504 -0
  21. package/src/Syndicate.ts +39 -0
  22. package/src/Utils.ts +85 -0
  23. package/src/{Weapon.js → Weapon.ts} +23 -3
  24. package/src/XpInfo.ts +41 -0
  25. package/src/Enemy.js +0 -47
  26. package/src/Intrinsics.js +0 -77
  27. package/src/ItemConfig.js +0 -52
  28. package/src/LoadOutInventory.js +0 -53
  29. package/src/LoadOutItem.js +0 -155
  30. package/src/LoadOutPreset.js +0 -90
  31. package/src/Mission.js +0 -58
  32. package/src/OperatorLoadOuts.js +0 -77
  33. package/src/Polarity.js +0 -25
  34. package/src/Profile.js +0 -213
  35. package/src/ProfileParser.js +0 -50
  36. package/src/Pvp.js +0 -35
  37. package/src/Race.js +0 -33
  38. package/src/Scan.js +0 -22
  39. package/src/Stats.js +0 -340
  40. package/src/Syndicate.js +0 -34
  41. package/src/Utils.js +0 -66
  42. package/src/XpInfo.js +0 -35
  43. package/types/Ability.d.ts +0 -20
  44. package/types/ArchonCrystal.d.ts +0 -22
  45. package/types/ChallengeProgress.d.ts +0 -21
  46. package/types/Enemy.d.ts +0 -41
  47. package/types/Intrinsics.d.ts +0 -66
  48. package/types/ItemConfig.d.ts +0 -21
  49. package/types/LoadOutInventory.d.ts +0 -45
  50. package/types/LoadOutItem.d.ts +0 -92
  51. package/types/LoadOutPreset.d.ts +0 -45
  52. package/types/Mission.d.ts +0 -35
  53. package/types/OperatorLoadOuts.d.ts +0 -35
  54. package/types/Polarity.d.ts +0 -21
  55. package/types/Profile.d.ts +0 -154
  56. package/types/ProfileParser.d.ts +0 -41
  57. package/types/Pvp.d.ts +0 -31
  58. package/types/Race.d.ts +0 -28
  59. package/types/Scan.d.ts +0 -20
  60. package/types/Skin.d.ts +0 -19
  61. package/types/Stats.d.ts +0 -255
  62. package/types/Syndicate.d.ts +0 -26
  63. package/types/Utils.d.ts +0 -3
  64. package/types/Weapon.d.ts +0 -51
  65. package/types/XpInfo.d.ts +0 -28
package/src/Pvp.ts ADDED
@@ -0,0 +1,43 @@
1
+ export interface RawPvp {
2
+ type: string;
3
+ suitDeaths?: number;
4
+ suitKills?: number;
5
+ weaponKills?: number;
6
+ }
7
+
8
+ /**
9
+ * Player's conclave stats
10
+ * @module
11
+ */
12
+ export default class Pvp {
13
+ /**
14
+ * PVP match unique name
15
+ */
16
+ uniqueName: string;
17
+
18
+ /**
19
+ * Deaths for this match
20
+ */
21
+ warframeDeaths?: number;
22
+
23
+ /**
24
+ * Warframe kills
25
+ */
26
+ warframeKills?: number;
27
+
28
+ /**
29
+ * Weapon killes
30
+ */
31
+ weaponKills?: number;
32
+
33
+ /**
34
+ *
35
+ * @param {Object} pvp PVP data to parse
36
+ */
37
+ constructor(pvp: RawPvp) {
38
+ this.uniqueName = pvp.type;
39
+ this.warframeDeaths = pvp.suitDeaths;
40
+ this.warframeKills = pvp.suitKills;
41
+ this.weaponKills = pvp.weaponKills;
42
+ }
43
+ }
package/src/Race.ts ADDED
@@ -0,0 +1,36 @@
1
+
2
+ export type RawRace = Record<string, { highScore: number }>;
3
+
4
+ /**
5
+ * Represents a k-drive race
6
+ * @module
7
+ */
8
+ export default class Race {
9
+ /**
10
+ * Race name
11
+ */
12
+ uniqueName: string;
13
+ /**
14
+ * Race High score
15
+ */
16
+ highScore: number;
17
+
18
+ /**
19
+ *
20
+ * @param type Race name
21
+ * @param highScore high score
22
+ */
23
+ constructor(type: string, highScore: number) {
24
+ this.uniqueName = type;
25
+ this.highScore = highScore;
26
+ }
27
+
28
+ /**
29
+ * Created an array of Race objects from DE's Races array
30
+ * @param races Array of races
31
+ * @returns {Race[]} An array of races formatted in a more consumable way.
32
+ */
33
+ static fromRaceObject(races: RawRace) {
34
+ return Object.entries(races ?? {}).map(([type, { highScore }]) => new Race(type, highScore));
35
+ }
36
+ }
package/src/Scan.ts ADDED
@@ -0,0 +1,30 @@
1
+ export interface RawScan {
2
+ type: string;
3
+ scans: number;
4
+ }
5
+
6
+ /**
7
+ * Represents an enemy scanned to the codex
8
+ * @module
9
+ */
10
+ export default class Scan {
11
+ /**
12
+ * Enemy unique name
13
+ * @type {String}
14
+ */
15
+ uniqueName: string;
16
+
17
+ /**
18
+ * Number of scans done
19
+ * @type {number}
20
+ */
21
+ scans: number;
22
+
23
+ /**
24
+ * @param {Object} scan The scanned Warframe object
25
+ */
26
+ constructor(scan: RawScan) {
27
+ this.uniqueName = scan.type;
28
+ this.scans = scan.scans;
29
+ }
30
+ }
@@ -1,23 +1,31 @@
1
- import { find } from './Utils.js';
1
+ import type { Item } from '@wfcd/items';
2
+ import { find } from './Utils';
3
+
4
+ export interface RawSkin {
5
+ ItemType: string
6
+ }
2
7
 
3
8
  /**
4
9
  * A skin class
5
10
  * @module
6
11
  */
7
12
  export default class Skin {
13
+ uniqueName: string;
14
+ item?: Item;
15
+
8
16
  /**
9
17
  *
10
- * @param {Object} skin The skin data to parse
11
- * @param {string} [locale='en'] The locale to return skin item in
18
+ * @param skin The skin data to parse
19
+ * @param locale The locale to return skin item in
12
20
  */
13
- constructor(skin, locale = 'en') {
21
+ constructor(skin: RawSkin, locale = 'en') {
14
22
  /**
15
23
  * Unique name
16
- * @type {String}
17
24
  */
18
25
  this.uniqueName = skin.ItemType;
19
26
 
20
27
  const item = find(skin.ItemType, locale);
28
+
21
29
  /**
22
30
  * The Warframe item that matches the unique name
23
31
  */
@@ -30,4 +38,4 @@ export default class Skin {
30
38
  * @param {Object} skin Skin object
31
39
  * @returns {Skin} Skin object with possible item
32
40
  */
33
- export const WeaponSkin = (skin) => new Skin(skin);
41
+ export const WeaponSkin = (skin: RawSkin) => new Skin(skin);
package/src/Stats.ts ADDED
@@ -0,0 +1,504 @@
1
+ import Ability, { type RawAbility } from './Ability';
2
+ import Enemy, { type RawEnemy } from './Enemy';
3
+ import Mission, { type RawMission } from './Mission';
4
+ import Pvp, { type RawPvp } from './Pvp';
5
+ import Race, { type RawRace } from './Race';
6
+ import Scan, { type RawScan } from './Scan';
7
+ import Weapon, { type RawWeapon } from './Weapon';
8
+
9
+ export interface RawStats {
10
+ GuildName: string;
11
+ MissionsCompleted: number;
12
+ MissionsQuit: number;
13
+ MissionsFailed: number;
14
+ MissionsInterrupted: number;
15
+ MissionsDumped: number;
16
+ PickupCount: number;
17
+ Weapons: RawWeapon[];
18
+ Enemies: RawEnemy[];
19
+ ExcavationEventScoreMax?: number;
20
+ ForestEventScoreMax?: number;
21
+ ForestEventScoreSum?: number;
22
+ MeleeKills: number;
23
+ Abilities: RawAbility[];
24
+ CiphersSolved: number;
25
+ CiphersFailed: number;
26
+ Income: number;
27
+ TimePlayedSec: number;
28
+ CipherTime: number;
29
+ Rating: number;
30
+ Rank: number;
31
+ Deaths: number;
32
+ PlayerLevel: number;
33
+ Missions: RawMission[];
34
+ HealCount: number;
35
+ HiveEventScore?: number;
36
+ HiveEventScoreSum?: number;
37
+ InvasionEventGrineerScore?: number;
38
+ InvasionEventCorpusScore?: number;
39
+ Scans: RawScan[];
40
+ ReviveCount: number;
41
+ FomorianEventScore?: number;
42
+ PVP?: RawPvp[];
43
+ PVPSpeedballTies?: number;
44
+ PVPSpeedballChecks?: number;
45
+ PVPSpeedballGoals?: number;
46
+ PVPSpeedballInterceptions?: number;
47
+ PVPSpeedballSteals?: number;
48
+ PVPSpeedballPoints?: number;
49
+ PVPSpeedballLosses?: number;
50
+ PVPSpeedballAssists?: number;
51
+ PVPSpeedballWins?: number;
52
+ PVPSpeedballSaves?: number;
53
+ PVPSpeedballPasses?: number;
54
+ DojoObstacleScore?: number;
55
+ PvpGamesPendingMask?: number;
56
+ DedicatedServerGamesCompleted?: number;
57
+ ColonistRescueEventScoreMax?: number;
58
+ AmbulasEventScoreMax?: number;
59
+ SentinelGameScore?: number;
60
+ AmalgamEventScoreMax?: number;
61
+ FlotillaEventScore?: number;
62
+ FlotillaGroundBadgesTier1?: number;
63
+ FlotillaGroundBadgesTier2?: number;
64
+ FlotillaGroundBadgesTier3?: number;
65
+ FlotillaSpaceBadgesTier1?: number;
66
+ FlotillaSpaceBadgesTier2?: number;
67
+ FlotillaSpaceBadgesTier3?: number;
68
+ MechSurvivalScoreMax: number;
69
+ ZephyrScore?: number;
70
+ Races: RawRace;
71
+ PortalEventScore?: number;
72
+ RiotMoaEventScore?: number;
73
+ RiotMoaEventScoreMax?: number;
74
+ ProjectSinisterEventScore?: number;
75
+ KelaEventBonusScoreMax?: number;
76
+ Halloween19ScoreMax?: number;
77
+ SurvivalEventScore?: number;
78
+ InfestedEventScore?: number;
79
+ }
80
+
81
+ interface Lunaro {
82
+ ties: number;
83
+ checks: number;
84
+ goals: number;
85
+ interceptions: number;
86
+ steals: number;
87
+ points: number;
88
+ losses: number;
89
+ assists: number;
90
+ wins: number;
91
+ saves: number;
92
+ passes: number;
93
+ }
94
+
95
+ interface ScarletSpear {
96
+ eventScore: number;
97
+ condrixTier1: number;
98
+ condrixTier2: number;
99
+ condrixTier3: number;
100
+ murexTier1: number;
101
+ murexTier2: number;
102
+ murexTier3: number;
103
+ }
104
+
105
+ /**
106
+ * A player's overall career stats
107
+ * @module
108
+ */
109
+ export default class Stats {
110
+ /**
111
+ * Guild name
112
+ */
113
+ guildName: string;
114
+
115
+ /**
116
+ * Missions completed
117
+ */
118
+ missionsCompleted: number;
119
+
120
+ /**
121
+ * Missions quit
122
+ */
123
+ missionsQuit: number;
124
+
125
+ /**
126
+ * Misions failed
127
+ */
128
+ missionsFailed: number;
129
+
130
+ /**
131
+ * Missions interrupted
132
+ */
133
+ missionsInterrupted: number;
134
+
135
+ /**
136
+ * Missions dumped
137
+ */
138
+ missionsDumped: number;
139
+
140
+ /**
141
+ * Items picked up
142
+ */
143
+ pickupCount: number;
144
+
145
+ /**
146
+ * Stats per weapon
147
+ */
148
+ weapons: Weapon[];
149
+
150
+ /**
151
+ * Stats on enemy encounters.
152
+ */
153
+ enemies: Enemy[];
154
+
155
+ /**
156
+ * Max score for Operation: Cryotic Front
157
+ */
158
+ excavationEventScoreMax?: number;
159
+
160
+ /**
161
+ * Max scoring for The Cicero crisis
162
+ */
163
+ forestEventScoreMax?: number;
164
+
165
+ /**
166
+ * Clan scoring for The Cicero crisis
167
+ */
168
+ forestEventScoreSum?: number;
169
+
170
+ /**
171
+ * Melee kills
172
+ */
173
+ meleeKills: number;
174
+
175
+ /**
176
+ * Used abilities
177
+ */
178
+ abilities: Ability[];
179
+
180
+ /**
181
+ * Ciphers completed successfully
182
+ */
183
+ ciphersSolved: number;
184
+
185
+ /**
186
+ * Ciphers failed
187
+ */
188
+ ciphersFailed: number;
189
+
190
+ /**
191
+ * Gross income
192
+ */
193
+ income: number;
194
+
195
+ /**
196
+ * Total play time since account creation
197
+ */
198
+ timePlayedSec: number;
199
+
200
+ /**
201
+ * Average time to hack a panel
202
+ */
203
+ cipherTime: number;
204
+
205
+ /**
206
+ * N/A
207
+ */
208
+ rating: number;
209
+
210
+ /**
211
+ * Mastery rank
212
+ */
213
+ rank: number;
214
+
215
+ /**
216
+ * Total deaths since account creation
217
+ */
218
+ deaths: number;
219
+
220
+ /**
221
+ * Mastery rank
222
+ */
223
+ playerLevel: number;
224
+
225
+ /**
226
+ * List of missions and high scores
227
+ */
228
+ missions: Mission[];
229
+
230
+ /**
231
+ * Team heals
232
+ */
233
+ healCount: number;
234
+
235
+ /**
236
+ * Event Scores for Operation breeding grounds
237
+ */
238
+ breedGrounds?: { personalScore: number; clanScore: number };
239
+
240
+ /**
241
+ * Event Scores for The Gradivus Dilemma
242
+ */
243
+ gradivusDilemma?: { grineer: number; corpus: number };
244
+
245
+ /**
246
+ * List of scanned Warframe objects
247
+ */
248
+ scans: Scan[];
249
+
250
+ /**
251
+ * Team revives
252
+ */
253
+ reviveCount: number;
254
+
255
+ /**
256
+ * Score for Operation: Eyes of Blight
257
+ */
258
+ fomorianEventScore?: number;
259
+
260
+ /**
261
+ * Conclave scores
262
+ */
263
+ pvp: Pvp[];
264
+
265
+ /**
266
+ * Lunaro stats
267
+ */
268
+ lunaro: Lunaro;
269
+
270
+ /**
271
+ * Dojo obstacle course goal
272
+ */
273
+ dojoObstacleScore: number;
274
+
275
+ /**
276
+ * N/A
277
+ */
278
+ pvpGamesPendingMask: number;
279
+
280
+ /**
281
+ * N/A
282
+ */
283
+ dedicatedServerGamesCompleted: number;
284
+
285
+ /**
286
+ * Event score for the Pacifism Defect
287
+ */
288
+ pacifismDefect?: number;
289
+
290
+ /**
291
+ * Score for operation Ambulas reborn.
292
+ */
293
+ ambulasReborn?: number;
294
+
295
+ /**
296
+ * Score for Wyrmius mini game
297
+ */
298
+ sentinelGameScore?: number;
299
+
300
+ /**
301
+ * Event score for operation hostile merger
302
+ */
303
+ amalgamEventScoreMax?: number;
304
+
305
+ /**
306
+ * Operation Scarlet spear event score and badges
307
+ */
308
+ scarletSpear?: ScarletSpear;
309
+
310
+ /**
311
+ * Operation: Orphix Venom score
312
+ */
313
+ orphixVenomScore?: number;
314
+
315
+ /**
316
+ * Play's Highest score in Happy Zephyr
317
+ */
318
+ happyZephyrScore: number;
319
+
320
+ /**
321
+ * K-Drive races
322
+ */
323
+ kDriveRaces: Race[];
324
+
325
+ /**
326
+ * Operation Gate Crash event
327
+ */
328
+ gateCrash?: number;
329
+
330
+ /**
331
+ * Per mission score for Operation: False Profit
332
+ */
333
+ falseProfitMissionScore?: number;
334
+
335
+ /**
336
+ * Total even score for Operation: False Profit
337
+ */
338
+ falseProfitEventScore?: number;
339
+
340
+ /**
341
+ * Operation: Shadow Debt event score
342
+ */
343
+ shadowDebtEventScore?: number;
344
+
345
+ /**
346
+ * Operation: Rathuum event score
347
+ */
348
+ rathuumEventScore?: number;
349
+
350
+ /**
351
+ * Hollowed flame event max score
352
+ */
353
+ hallowedFlameScoreMax?: number;
354
+
355
+ /**
356
+ * Survival Weekend event score
357
+ */
358
+ survivalWeekenedEventScore?: number;
359
+
360
+ /**
361
+ * N/A
362
+ */
363
+ infestedEventScore?: number;
364
+
365
+ /**
366
+ *
367
+ * @param stats Player stats
368
+ */
369
+ constructor(stats: RawStats) {
370
+ this.guildName = stats.GuildName;
371
+
372
+ this.missionsCompleted = stats.MissionsCompleted;
373
+
374
+ this.missionsQuit = stats.MissionsQuit;
375
+
376
+ this.missionsFailed = stats.MissionsFailed;
377
+
378
+ this.missionsInterrupted = stats.MissionsInterrupted;
379
+
380
+ this.missionsDumped = stats.MissionsDumped;
381
+
382
+ this.pickupCount = stats.PickupCount;
383
+
384
+ this.weapons = stats.Weapons.map((w) => new Weapon(w));
385
+
386
+ this.enemies = stats.Enemies.map((e) => new Enemy(e));
387
+
388
+ if (stats.ExcavationEventScoreMax) this.excavationEventScoreMax = stats.ExcavationEventScoreMax;
389
+
390
+ if (stats.ForestEventScoreMax) this.forestEventScoreMax = stats.ForestEventScoreMax;
391
+
392
+ if (stats.ForestEventScoreSum) this.forestEventScoreSum = stats.ForestEventScoreSum;
393
+
394
+ this.meleeKills = stats.MeleeKills;
395
+
396
+ this.abilities = stats.Abilities.map((a) => new Ability(a));
397
+
398
+ this.ciphersSolved = stats.CiphersSolved;
399
+
400
+ this.ciphersFailed = stats.CiphersFailed;
401
+
402
+ this.income = stats.Income;
403
+
404
+ this.timePlayedSec = stats.TimePlayedSec;
405
+
406
+ this.cipherTime = stats.CipherTime;
407
+
408
+ this.rating = stats.Rating;
409
+
410
+ this.rank = stats.Rank;
411
+
412
+ this.deaths = stats.Deaths;
413
+
414
+ this.playerLevel = stats.PlayerLevel;
415
+
416
+ this.missions = stats.Missions.map((m) => new Mission(m));
417
+
418
+ this.healCount = stats.HealCount;
419
+
420
+ if (stats.HiveEventScore || stats.HiveEventScoreSum) {
421
+ this.breedGrounds = {
422
+ personalScore: stats.HiveEventScore!,
423
+ clanScore: stats.HiveEventScoreSum!,
424
+ };
425
+ }
426
+
427
+ if (stats.InvasionEventGrineerScore || stats.InvasionEventCorpusScore) {
428
+ this.gradivusDilemma = {
429
+ grineer: stats.InvasionEventGrineerScore!,
430
+ corpus: stats.InvasionEventCorpusScore!,
431
+ };
432
+ }
433
+
434
+ this.scans = stats.Scans?.map((s) => new Scan(s)) ?? [];
435
+
436
+ this.reviveCount = stats.ReviveCount;
437
+
438
+ if (stats.FomorianEventScore) this.fomorianEventScore = stats.FomorianEventScore;
439
+
440
+ this.pvp = stats.PVP?.map((pvp) => new Pvp(pvp)) ?? [];
441
+
442
+ this.lunaro = {
443
+ ties: stats.PVPSpeedballTies ?? 0,
444
+ checks: stats.PVPSpeedballChecks ?? 0,
445
+ goals: stats.PVPSpeedballGoals ?? 0,
446
+ interceptions: stats.PVPSpeedballInterceptions ?? 0,
447
+ steals: stats.PVPSpeedballSteals ?? 0,
448
+ points: stats.PVPSpeedballPoints ?? 0,
449
+ losses: stats.PVPSpeedballLosses ?? 0,
450
+ assists: stats.PVPSpeedballAssists ?? 0,
451
+ wins: stats.PVPSpeedballWins ?? 0,
452
+ saves: stats.PVPSpeedballSaves ?? 0,
453
+ passes: stats.PVPSpeedballPasses ?? 0,
454
+ };
455
+
456
+ this.dojoObstacleScore = stats.DojoObstacleScore ?? 0;
457
+
458
+ this.pvpGamesPendingMask = stats.PvpGamesPendingMask ?? 0;
459
+
460
+ this.dedicatedServerGamesCompleted = stats.DedicatedServerGamesCompleted ?? 0;
461
+
462
+ if (stats.ColonistRescueEventScoreMax) this.pacifismDefect = stats.ColonistRescueEventScoreMax;
463
+
464
+ if (stats.AmbulasEventScoreMax) this.ambulasReborn = stats.AmbulasEventScoreMax;
465
+
466
+ if (stats.SentinelGameScore) this.sentinelGameScore = stats.SentinelGameScore;
467
+
468
+ if (stats.AmalgamEventScoreMax) this.amalgamEventScoreMax = stats.AmalgamEventScoreMax;
469
+
470
+ if (stats.FlotillaEventScore) {
471
+ this.scarletSpear = {
472
+ eventScore: stats.FlotillaEventScore,
473
+ condrixTier1: stats.FlotillaGroundBadgesTier1!,
474
+ condrixTier2: stats.FlotillaGroundBadgesTier2!,
475
+ condrixTier3: stats.FlotillaGroundBadgesTier3!,
476
+ murexTier1: stats.FlotillaSpaceBadgesTier1!,
477
+ murexTier2: stats.FlotillaSpaceBadgesTier2!,
478
+ murexTier3: stats.FlotillaSpaceBadgesTier3!,
479
+ };
480
+ }
481
+
482
+ if (stats.MechSurvivalScoreMax) this.orphixVenomScore = stats.MechSurvivalScoreMax;
483
+
484
+ this.happyZephyrScore = stats.ZephyrScore ?? 0;
485
+
486
+ this.kDriveRaces = Race.fromRaceObject(stats.Races);
487
+
488
+ if (stats.PortalEventScore) this.gateCrash = stats.PortalEventScore;
489
+
490
+ if (stats.RiotMoaEventScore) this.falseProfitMissionScore = stats.RiotMoaEventScore;
491
+
492
+ if (stats.RiotMoaEventScoreMax) this.falseProfitEventScore = stats.RiotMoaEventScoreMax;
493
+
494
+ if (stats.ProjectSinisterEventScore) this.shadowDebtEventScore = stats.ProjectSinisterEventScore;
495
+
496
+ if (stats.KelaEventBonusScoreMax) this.rathuumEventScore = stats.KelaEventBonusScoreMax;
497
+
498
+ if (stats.Halloween19ScoreMax) this.hallowedFlameScoreMax = stats.Halloween19ScoreMax;
499
+
500
+ if (stats.SurvivalEventScore) this.survivalWeekenedEventScore = stats.SurvivalEventScore;
501
+
502
+ if (stats.InfestedEventScore) this.infestedEventScore = stats.InfestedEventScore;
503
+ }
504
+ }
@@ -0,0 +1,39 @@
1
+ import { Locale } from 'warframe-worldstate-data';
2
+ import { syndicate } from 'warframe-worldstate-data/utilities';
3
+
4
+ export interface RawAffiliation {
5
+ Tag: string;
6
+ Standing: number;
7
+ Title: number;
8
+ }
9
+
10
+ /**
11
+ * Represents a syndicate
12
+ * @module
13
+ */
14
+ export default class Syndicate {
15
+ /**
16
+ * Name of the syndicate
17
+ */
18
+ name: string;
19
+
20
+ /**
21
+ * Current standing the player has with the syndicate
22
+ */
23
+ standing: number;
24
+
25
+ /**
26
+ * The player's current syndicate title
27
+ */
28
+ title: number;
29
+
30
+ /**
31
+ * @param affiliation The syndicate data
32
+ * @param locale locale code
33
+ */
34
+ constructor(affiliation: RawAffiliation, locale: Locale = 'en') {
35
+ this.name = syndicate(affiliation.Tag, locale);
36
+ this.standing = affiliation.Standing;
37
+ this.title = affiliation.Title;
38
+ }
39
+ }