Commit 772357a4 authored by Zohten's avatar Zohten

discarding works

parent 7da2f04f
......@@ -31,10 +31,8 @@ export default {
updated(){
},
methods: {
tileClickedListener: function(tile){
console.log('tile clicked');
console.log(tile);
let dicarded = this.Hand.discard(tile);
tileClickedListener: function(event){
let dicarded = this.Hand.discard(event.id_tuile);
console.log(dicarded);
}
}
......
......@@ -13,10 +13,7 @@ export default class Hand{
}
discard(tile){
console.log('tiles_left');
console.log(this.tiles_left);
const tile_ids = this.tiles_left.map(tile => tile.id_tuile);
console.log(tile_ids);
var index = tile_ids.indexOf(tile);
return this.tiles_left.splice(index, 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment