boaerd-tictactoe
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "boaerd-tictactoe", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Boaerd tic-tac-toe", | ||
@@ -5,0 +5,0 @@ "main": "src/Tictactoe.js", |
@@ -14,6 +14,7 @@ let Player = require('./Player'); | ||
this.message = (data, user) => { | ||
console.log(data, user); | ||
let pl = this.players.find(pl => pl && pl.id === user.id); | ||
switch(data.event) { | ||
case 'join' : | ||
this.players[data.data] = new Player(user.id, data.data+1, true); | ||
console.log(data.data); | ||
break; | ||
@@ -24,5 +25,3 @@ case 'putAI' : | ||
case 'remove' : | ||
let pl = this.players.find(pl => pl.id === user.id); | ||
this.players[this.players.indexOf(pl)] = null; | ||
console.log(data.data); | ||
break; | ||
@@ -59,3 +58,2 @@ case 'start' : | ||
this.currentPlayer = null; | ||
console.log('someone won', this.board.isWon()); | ||
this.winner = this.players.find(pl => pl.color === this.board.isWon()); | ||
@@ -68,3 +66,2 @@ this.updateListener.updated(); | ||
this.currentPlayer = null; | ||
console.log(this.board.cells); | ||
this.updateListener.updated(); | ||
@@ -71,0 +68,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
228750
1774