Skip to content

Commit

Permalink
cant undo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eguneys committed Jan 30, 2024
1 parent eb18358 commit ee9bf18
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2699,8 +2699,8 @@ class SceneTransition extends Play {

//this.current = this._make(CardShowcase, Vec2.zero, {})
// this.current = this._make(MainMenu, Vec2.zero, {})
this.current = this._make(Statistics2, Vec2.zero, {})
//this.current = this._make(MainMenu2, Vec2.zero, {})
//this.current = this._make(Statistics2, Vec2.zero, {})
this.current = this._make(MainMenu2, Vec2.zero, {})
//this.current = this._make(HowtoPlay2, Vec2.zero, {})
//this.current = this._make(Settings2, Vec2.zero, {})
//this.current = this._make(SolitairePlay, Vec2.zero, {})
Expand Down
1 change: 1 addition & 0 deletions src/showcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ export class Tableu extends Play {
}

remove_fronts(i: number) {
this.hover_end()
let cards = this.fronts.remove_cards(i)
return cards
}
Expand Down
14 changes: 13 additions & 1 deletion src/solitaire_game_dragful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class SolitaireGameDragful extends Play {
}

cant_undo() {
throw new Error("Method not implemented.");
//throw new Error("Method not implemented.");
}
undo(cmd: IMove) {
this.cards.undo(cmd)
Expand Down Expand Up @@ -537,6 +537,18 @@ class SolitaireCards extends Play {
this.tableus[i].add_fronts(fronts)

})


back.foundations.forEach((foundation, i) => {
let fs = foundation.foundation.cards.map(card => {
let c = this.cards.borrow()
c.card = card
c.flip_front()
return c
})

this.foundations[i].add_cards(fs)
})
}

_release_cancel_drag() {
Expand Down

0 comments on commit ee9bf18

Please sign in to comment.