void Awake() { movableComponent = GetComponent <MovablePiece>(); colorComponent = GetComponent <ColorPiece>(); selectableComponent = GetComponent <SelectablePiece>(); clearableComponent = GetComponent <ClearablePiece>(); }
public static Piece Create(string type, ColorPiece color, Coordinate coor) { if (type == ChessResources.Rook) { return(new Rook(color, coor)); } else if (type == ChessResources.Knight) { return(new Knight(color, coor)); } else if (type == ChessResources.Bishop) { return(new Bishop(color, coor)); } else if (type == ChessResources.Queen) { return(new Queen(color, coor)); } if (type == ChessResources.King) { return(new King(color, coor)); } else if (type == ChessResources.Pawn) { return(new Pawn(color, coor)); } return(null); }
public ColorPiece FindMatch(int col, int ii, int ii2, int[] rpos, int[] rlen, bool[] reverse) { IntPtr cPtr = HCSMVOPINVOKE.ColorPieceList_FindMatch(swigCPtr, col, ii, ii2, rpos, rlen, reverse); ColorPiece ret = (cPtr == IntPtr.Zero) ? null : new ColorPiece(cPtr, false); return(ret); }
public void StartNewGame() //JS: btnNewGame click { Session["chessboard"] = new Chessboard(); actualPosibleMovements = null; colorWhoMove = ColorPiece.White; actualPieceSelected = null; this.Index(); }
void Awake() { movableComponent = GetComponent <MovablePiece> (); colorComponent = GetComponent <ColorPiece> (); clearableComponent = GetComponent <ClearablePiece> (); generativeComponent = GetComponent <GenerativePiece>(); scaleableComponent = GetComponent <ScaleablePiece>(); }
public static ColorPiece ToogleColor(this ColorPiece colorPiece) { if (colorPiece == ColorPiece.Black) { colorPiece = ColorPiece.White; } else { colorPiece = ColorPiece.Black; } return(colorPiece); }
public JsonResult Move(int x, int y) //JS: move { Movement actual = this.actualPosibleMovements.Where(w => w.TentativeCoordinate.CompareTo(x, y)).FirstOrDefault(); if (actual == null) { throw new HttpRequestValidationException("No se encontro el movimiento seleccionado"); } bool fin = this.chessboard.Move(actual); JsonResult result; this.chessboard.colorMoved = colorWhoMove.ToString().ToUpper(); //Color que movio colorWhoMove = colorWhoMove.ToogleColor(); this.chessboard.colorWhoDoMove = colorWhoMove.ToString().ToUpper(); //color que le toca mover result = Json(new { colorMoved = actual.piece.color, color = colorWhoMove, resultado = fin }); return(result); }
private void Awake() { //若有移动脚本说明可以移动 moveableComponent = this.GetComponent <MoveablePiece>(); if (moveableComponent != null) { isMoveable = true; } //有颜色组件说明可以变换颜色 colorComponent = this.GetComponent <ColorPiece>(); if (colorComponent != null) { isColor = true; } //有消除组件说明可以消除 clearComponent = GetComponent <ClearablePiece>(); if (clearComponent != null) { isClear = true; } }
public Knight(ColorPiece paramColor, Coordinate initialCoordinate) : base(paramColor, initialCoordinate) { }
void Awake() { movableComponent = GetComponent <Movablepiece>();//通过查看该属性是否为空来判断当前物体是否能移动 colorComponent = GetComponent <ColorPiece>(); clearableComponent = GetComponent <ClearablePiece>(); }
public Piece(ColorPiece paramColor, Coordinate initialCoordinate) { this._color = paramColor; this.coordinate = initialCoordinate; }
public Rook(ColorPiece paramColor, Coordinate initialCoordinate) : base(paramColor, initialCoordinate) { }
void Awake() { movableComponent = GetComponent <MovablePiece> (); colorComponent = GetComponent <ColorPiece> (); }
public Bishop(ColorPiece paramColor, Coordinate initialCoordinate) : base(paramColor, initialCoordinate) { }
private void Awake() { movableComponent = GetComponent <movablepiece>(); colorPieceComponent = GetComponent <ColorPiece>(); clearableComponent = GetComponent <Clearablepiece>(); }
private void Awake() { movableComponent = this.GetComponent <MovablePiece>(); colorComponent = this.GetComponent <ColorPiece>(); clearableComponent = GetComponent <ClearablePiece>(); }
void Awake() { movable = GetComponent <MovablePiece>(); color = GetComponent <ColorPiece>(); clearable = GetComponent <ClearablePiece>(); }
public static HandleRef getCPtr(ColorPiece obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }