import { PLAYER , PIECE } from './define' ; export default class Piece { owner : PLAYER ; type : PIECE ; constructor ( owner , type ) { this . type = type ; this . owner = owner ; } equals ( piece ) { return this . type === piece . type && this . owner === piece . owner ; } isOwnedBy ( owner ) { return this . owner === owner ; } isSameOwnerWith ( piece ) { return this . owner === piece . owner ; } clone ( ) { return new Piece ( this . owner , this . type ) ; } }