Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
added discard method to player
Browse files Browse the repository at this point in the history
  • Loading branch information
null committed Apr 3, 2024
1 parent 28426b8 commit fae13e8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ class Player {
this.hp = 25;
this.actions = 2;
}

discard(index: number = -1) {
if(index == -1){
index = Math.floor(Math.random()*this.hand.length)
}

this.discardPile.push(this.hand[index])
this.hand.splice(index,1)
}
}

class BoardPos {
Expand Down

0 comments on commit fae13e8

Please sign in to comment.