File

src/client/app/modules/puzzle/services/board/board.model.ts

Implements

ModelInterface

Index

Properties
Methods

Constructor

constructor(rowCount: number, colCount: number, isSolved: boolean, sequence: number[], expectedSequence: number[])

Methods

toString
toString()
Returns : string

Properties

Private _squares
_squares: []
Type : []
Public colCount
colCount: number
Type : number
Default value : 0
Public expectedSequence
expectedSequence: number[]
Type : number[]
Public isSolved
isSolved: boolean
Type : boolean
Default value : false
Public rowCount
rowCount: number
Type : number
Default value : 0
Public sequence
sequence: number[]
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 + ' }';
  }

}

results matching ""

    No results matching ""