public void DrawSerpentCell(Serpent serpent, int idx) { Cell cell = serpent.GetCell(idx); Rectangle rect = GetCellRect(cell.Row, cell.Col); RelateDirection before = serpent.GetCellRelation(idx, -1); RelateDirection after = serpent.GetCellRelation(idx, 1); cell.Draw(_graphic, rect, CellMargin, idx, before, after); }
private bool CannotMoveByKeyboard(Cell cell) { if (cell == null) { return(true); } Cell neck = serpent.GetCell(1); if (cell.IsSamePostion(neck)) { return(true); } return(false); }