src/client/app/modules/puzzle/services/board/board.model.ts
Properties |
Methods |
constructor(rowCount: number, colCount: number, isSolved: boolean, sequence: number[], expectedSequence: number[])
|
| toString |
toString()
|
|
Returns :
string
|
| Private _squares |
_squares:
|
Type : []
|
| Public colCount |
colCount:
|
Type : number
|
Default value : 0
|
| Public expectedSequence |
expectedSequence:
|
Type : number[]
|
| Public isSolved |
isSolved:
|
Type : boolean
|
Default value : false
|
| Public rowCount |
rowCount:
|
Type : number
|
Default value : 0
|
| Public sequence |
sequence:
|
Type : number[]
|
| squares |
squares:
|
Type : []
|
import { Square } from './square.model';
import { ModelInterface } from '../../interfaces/model.interface';
export class Board implements ModelInterface {
private _squares: Square[];
get squares(): Square[] {
return this._squares;
}
set squares(value: Square[]) {
this._squares = value;
}
constructor(
public rowCount: number = 0,
public colCount: number = 0,
public isSolved: boolean = false,
public sequence: number[] = [],
public expectedSequence: number[] = []
) {
this._squares = [];
}
toString(): string {
return '{ rows: ' + this.rowCount + ', cols: ' + this.colCount + ', isSolved: ' +
this.isSolved + ', sequence: ' + JSON.stringify(this.sequence) +
', expectedSequence: ' + JSON.stringify(this.expectedSequence) +
', squares:' + this._squares.length + ' }';
}
}