16 lines
326 B
JavaScript
16 lines
326 B
JavaScript
class Player {
|
|
constructor(id, name) {
|
|
this.id = id;
|
|
this.name = name;
|
|
this.pieces = [];
|
|
this.colors = settings.colors['piece_' + id];
|
|
this.score = 0;
|
|
}
|
|
|
|
get_positions() {
|
|
return this.pieces.map(function (piece) {
|
|
return piece.coord;
|
|
});
|
|
}
|
|
}
|