Simply factory produce ChessPiece/ChessGasket/ChessVO/OmenVO and relatived properties.
protected var chessBoardModel:ChessBoardModelprotected var chessGasketsModel:ChessGasketsModelprotected var chessGasketTips:Stringprotected var chessPieceLabel:Stringprotected var chessPieceName:Stringprotected var chessPiecesModel:ChessPiecesModelprotected var chessPieceSource:Objectprotected var chessPieceSubType:String = nullprotected var chessPieceType:Stringprotected var chessPieceValue:int = 0public function ChessFactoryBase() public function createChessBoard(type:String):IChessBoard
Create the type specialed chess board
Parameters
| type:String — the chess board type(intersection,checkering,segament,fractal...)
|
Returns public function createChessGasket(position:Point):IChessGasket
Chess gasket manipulate.
Parameters
Returns | IChessGasket — ChessGasket component which implement IChessGasket
|
public function createChessPiece(position:Point, flag:uint = 0):IChessPiece
Chess piece manipulate procedure.
Parameters
| position:Point — chessPiece's position type is Point(x, y).
|
| |
| flag:uint (default = 0) — chessPices's side flag.(red/blue).
|
Returns | IChessPiece — ChessPiece component with implement IChessPiece or NULL.
|
public function generateChessVO(conductVO:ConductVO):IChessVO
ChessVO manipulate.
Parameters
| conductVO:ConductVO — has property target(type is chessPiece) and newPosition([0,1]).
|
Returns | IChessVO — precise chess value object(prototype is chessVOBase).
|
public function generateOmenVO(conductVO:ConductVO):OmenVO
OmenVO manipulate.
Parameters
| conductVO:ConductVO — has property target(type is chessPiece) and newPosition([0,1]).
|
Returns | OmenVO — precise chess value object(prototype is OmenVO).
|
Thu Jan 16 2014, 01:11 PM +08:00