This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(model): update model to handle phase, bossFights
- Loading branch information
Benjamin Reed
committed
Oct 23, 2020
1 parent
6d412c0
commit 6147a93
Showing
12 changed files
with
3,640 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
import { Entry } from './_entry'; | ||
import { Game } from './game'; | ||
import { ID } from './_entry'; | ||
|
||
export class BossFight extends Entry { | ||
interface damageResult { | ||
dmg: number; | ||
dmgType: number; | ||
playerSource: ID; | ||
teamTarget: ID; | ||
} | ||
|
||
export class BossFight extends Game { | ||
awayHp: string; | ||
awayMaxHp: string; | ||
homeHp: string; | ||
homeMaxHp: string; | ||
repeatCount: number; | ||
|
||
constructor(data?: any) { | ||
super(data); | ||
|
||
this.defineStrings([ | ||
'awayHp', | ||
'awayMaxHp', | ||
'homeHp', | ||
'homeMaxHp', | ||
]); | ||
|
||
} | ||
|
||
// "damageResults": "[{\"dmgType\":5,\"teamTarget\":\"40b9ec2a-cb43-4dbb-b836-5accb62e7c20\",\"playerSource\":\"04e14d7b-5021-4250-a3cd-932ba8e0a889\",\"dmg\":382}]", | ||
public get damageResults(): damageResult[] { | ||
if (this.data?.damageResults) { | ||
try { | ||
return JSON.parse(this.data?.damageResults) as damageResult[]; | ||
} catch (err) { | ||
console.error('Unable to parse damage results:', err); | ||
} | ||
} | ||
return []; | ||
} | ||
} |
Oops, something went wrong.