Commit 772357a4 authored by Zohten's avatar Zohten

discarding works

parent 7da2f04f
...@@ -31,10 +31,8 @@ export default { ...@@ -31,10 +31,8 @@ export default {
updated(){ updated(){
}, },
methods: { methods: {
tileClickedListener: function(tile){ tileClickedListener: function(event){
console.log('tile clicked'); let dicarded = this.Hand.discard(event.id_tuile);
console.log(tile);
let dicarded = this.Hand.discard(tile);
console.log(dicarded); console.log(dicarded);
} }
} }
......
...@@ -13,10 +13,7 @@ export default class Hand{ ...@@ -13,10 +13,7 @@ export default class Hand{
} }
discard(tile){ discard(tile){
console.log('tiles_left');
console.log(this.tiles_left);
const tile_ids = this.tiles_left.map(tile => tile.id_tuile); const tile_ids = this.tiles_left.map(tile => tile.id_tuile);
console.log(tile_ids);
var index = tile_ids.indexOf(tile); var index = tile_ids.indexOf(tile);
return this.tiles_left.splice(index, 1); 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