Skip to content

Commit

Permalink
feat(models): update Creature model
Browse files Browse the repository at this point in the history
make ranged field required

add special and description fields
  • Loading branch information
rudnovd committed Jan 29, 2022
1 parent b7dfc7c commit 6465f8b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/models/Creature.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CreaturesSpecial } from '@/models/CreaturesSpecials'
import type { Spell } from './Spell'

export interface Creature {
Expand All @@ -16,16 +17,19 @@ export interface Creature {
nativeTerrain: number
speed?: number
name: string
ranged?: boolean
ranged: boolean
townId?: number
hexs?: number
shots?: number
hates?: Array<number>
special?: CreaturesSpecial
description?: string
}

export interface CreatureTranslation {
id: number
name: string
description?: string
}

export class CreatureInstance implements Creature {
Expand All @@ -44,11 +48,13 @@ export class CreatureInstance implements Creature {
nativeTerrain: number
speed?: number
name: string
ranged?: boolean
ranged: boolean
townId?: number
hexs?: number
shots?: number
hates?: number[]
special?: CreaturesSpecial
description?: string

count: number
effects: Array<Spell>
Expand Down Expand Up @@ -84,6 +90,8 @@ export class CreatureInstance implements Creature {
this.townId = creature.townId
this.hexs = creature.hexs
this.hates = creature.hates
this.special = creature.special
this.description = creature.description
this.count = 1
this.effects = []
this.calculation = {
Expand Down

0 comments on commit 6465f8b

Please sign in to comment.