Player
Provides all the logic to create instance of Player
Constructor Summary
Public Constructor | ||
public |
constructor(user: Object | *, options: Object) Initializes a new instance of the |
Member Summary
Public Members | ||
public get |
isComputer: Boolean: * |
|
public set |
isComputer(bool: Boolean): * |
Method Summary
Public Methods | ||
public |
Returns string representation of Player instance |
Public Constructors
public constructor(user: Object | *, options: Object) source
Initializes a new instance of the Player
class.
Example:
Example 1
// Creating a new instance
var player1 = new Player({name: 'Player 1'});
Example 2
// You can pass any object that has defined toString() method:
var playerObj = {
name: 'Ben',
toString() { return this.name; }
};
var player2 = new Player(playerObj);