GODPAPER | All Packages | All Classes | Index | Frames No Frames |
AbstractChessVO

Package | com.godpaper.as3.impl
Class | public class AbstractChessVO
Inheritance | AbstractChessVO BitBoard BitVector Object
Implements | com.godpaper.as3.core.IChessVO
Subclasses | ChessVO_TicTacToe

See also

http://chessprogramming.wikispaces.com/X-ray+Attacks
http://chessprogramming.wikispaces.com/Classical+Approach
http://www.nicolabortignon.com/as3-bitwise-operations/

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | bitCount : int [read-only] The total number of bits. | BitVector
|  | captures : BitBoard | AbstractChessVO
|  | cellCount : int [read-only] The total number of cells. | BitVector
|  | celled : int [read-only] | BitBoard
|  | column : int [read-only] | BitBoard
|  | defends : BitBoard | AbstractChessVO
|  | isEmpty : Boolean [read-only] whether or not bitboard is empty; | BitBoard
|  | moves : BitBoard | AbstractChessVO
|  | occupies : BitBoard | AbstractChessVO
|  | row : int [read-only] | BitBoard

Protected Properties

| Property | Defined By
--- | --- | ---
|  | blocker : BitBoard | AbstractChessVO
|  | chessGasketModel : ChessGasketsModel | AbstractChessVO
|  | chessPiecesModel : ChessPiecesModel | AbstractChessVO
|  | flag : int | AbstractChessVO
|  | identifier : String | AbstractChessVO

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | AbstractChessVO(width:int, height:int, rowIndex:int, colIndex:int, flag:uint = 1, identifier:String) Customize construct the abstracted chess vo with parameters. | AbstractChessVO
|  | and(value:BitBoard):BitBoard | BitBoard
|  | clear():void [override] Resets all bits to 0; | BitBoard
|  | clone():BitBoard | BitBoard
|  | dump():String Dump out a string representing the current object. | BitBoard
|  | getBit(index:int):int Gets a bit from a given index. | BitVector
|  | getBitt(row:int, column:int):int Gets a bit from a given row and column. | BitBoard
|  | getCols(colIndex:int):Array | BitBoard
|  | getEast(rowIndex:int, colIndex:int):BitBoard | AbstractChessVO
|  | getNorth(rowIndex:int, colIndex:int):BitBoard | AbstractChessVO
|  | getRows(rowIndex:int):Array | BitBoard
|  | getSouth(rowIndex:int, colIndex:int):BitBoard | AbstractChessVO
|  | getWest(rowIndex:int, colIndex:int):BitBoard | AbstractChessVO
|  | initialization(rowIndex:int, colIndex:int, flag:uint = 0, identifier:String):void | AbstractChessVO
|  | not():BitBoard | BitBoard
|  | or(value:BitBoard):BitBoard | BitBoard
|  | resize(size:int):void Resizes the bit-vector to an appropriate number of bits. | BitVector
|  | reverse():BitBoard | BitBoard
|  | rotate45():BitBoard notice:this function is suitable for which board column equals to row. | BitBoard
|  | rotate90():BitBoard | BitBoard
|  | setAll():void [override] Sets each bit to 1. | BitBoard
|  | setBit(index:int, b:Boolean):void Sets a bit at a given index. | BitVector
|  | setBitt(row:int, column:int, b:Boolean):void Sets a bit at a given row and column. | BitBoard
|  | toString():String [override] Prints out a string representing the current object. | BitBoard
|  | xor(value:BitBoard):BitBoard | BitBoard

Property Detail

blocker | property

`protected var blocker:BitBoard`

captures | property |

`captures:BitBoard`

Implementation
`public function get captures():BitBoard`
`public function set captures(value:BitBoard):void`

chessGasketModel | property |

`protected var chessGasketModel:ChessGasketsModel`

chessPiecesModel | property |

`protected var chessPiecesModel:ChessPiecesModel`

defends | property |

`defends:BitBoard`

Implementation
`public function get defends():BitBoard`
`public function set defends(value:BitBoard):void`

flag | property |

`protected var flag:int`

identifier | property |

`protected var identifier:String`

moves | property |

`moves:BitBoard`

Implementation
`public function get moves():BitBoard`
`public function set moves(value:BitBoard):void`

occupies | property |

`occupies:BitBoard`

Implementation
`public function get occupies():BitBoard`
`public function set occupies(value:BitBoard):void`
Constructor Detail

AbstractChessVO | () | Constructor

`public function AbstractChessVO(width:int, height:int, rowIndex:int, colIndex:int, flag:uint = 1, identifier:String)`

Customize construct the abstracted chess vo with parameters.

Parameters

| `width:int` — width value of bitboard;
| `height:int` — height value of bitboard;
| `rowIndex:int` — rowIndex of destination point;
| `colIndex:int` — colIndex of destination point;
| `flag:uint` (default = `1`)`` — flag you wanna set(red is 0,blue is 1).
| `identifier:String` — identifier of ChessVO.

Method Detail

getEast | () | method

`public function getEast(rowIndex:int, colIndex:int):BitBoard`

Parameters

| `rowIndex:int` — current piece's row index.
| `colIndex:int` — current piece's column index.

Returns

| `BitBoard` — legal moves prototype is bit board under east direction.

getNorth | () | method |

`public function getNorth(rowIndex:int, colIndex:int):BitBoard`

Parameters

| `rowIndex:int` — current piece's row index.
| `colIndex:int` — current piece's column index.

Returns

| `BitBoard` — legal moves prototype is bit board under north direction.

getSouth | () | method |

`public function getSouth(rowIndex:int, colIndex:int):BitBoard`

Parameters

| `rowIndex:int` — current piece's row index.
| `colIndex:int` — current piece's column index.

Returns

| `BitBoard` — legal moves prototype is bit board under south direction.

getWest | () | method |

`public function getWest(rowIndex:int, colIndex:int):BitBoard`

Parameters

| `rowIndex:int` — current piece's row index.
| `colIndex:int` — current piece's column index.

Returns

| `BitBoard` — legal moves prototype is bit board under west direction.

initialization | () | method |

`public function initialization(rowIndex:int, colIndex:int, flag:uint = 0, identifier:String):void`

Parameters

| `rowIndex:int` — rowIndex you wanna set bit flag.
| `colIndex:int` — colIndex you wanna set big flag.
| `flag:uint` (default = `0`)`` — flag you wanna set(red is 0,blue is 1).
| `identifier:String` — identifier of ChessVO.

See also

mx.utils.BitFlagUtil.update

Thu Jan 16 2014, 01:11 PM +08:00