void AppendChessToCell(IChessUnit chess, CellUnit cell) { var to = cell.Layout.Transform; chess.Layout.AppendTo(to); chess.Index = cell.Index; }
public void Remove(IChessUnit chess) { if (!ActiveChesses.Contains(chess)) { return; } chess.Layout.AppendTo(mIdleRoot); ActiveChesses.Remove(chess); IdleChesses.Enqueue(chess); }
bool HasAttackChance(IChessUnit chess) { var startCell = mCells.Get(chess.Index); if (GetJumpableCell(startCell, LinkDirection.Up) != null) { return(true); } if (GetJumpableCell(startCell, LinkDirection.Bottom) != null) { return(true); } if (GetJumpableCell(startCell, LinkDirection.Right) != null) { return(true); } if (GetJumpableCell(startCell, LinkDirection.Left) != null) { return(true); } return(false); }