Example #1
0
        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);
        }
Example #2
0
        private bool CannotMoveByKeyboard(Cell cell)
        {
            if (cell == null)
            {
                return(true);
            }
            Cell neck = serpent.GetCell(1);

            if (cell.IsSamePostion(neck))
            {
                return(true);
            }
            return(false);
        }