Skip to content

Commit

Permalink
feat(Battle): add helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd committed Jul 29, 2022
1 parent 02bba32 commit e71781d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/models/Battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import type { Terrain } from './Terrain'

export type BattleSide = 'attacker' | 'defender'

export function getOppositeBattleSide(side: BattleSide): string {
return side === 'attacker' ? 'defender' : 'attacker'
}

export interface DamageCalculatorBattleSide {
hero: HeroInstance | null
creatures: Array<CreatureInstance>
Expand Down

0 comments on commit e71781d

Please sign in to comment.