示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (VerticalColumns != 0)
            {
                hash ^= VerticalColumns.GetHashCode();
            }
            if (HorizontalColumns != 0)
            {
                hash ^= HorizontalColumns.GetHashCode();
            }
            if (VerticalLines.Length != 0)
            {
                hash ^= VerticalLines.GetHashCode();
            }
            if (HorizontalLines.Length != 0)
            {
                hash ^= HorizontalLines.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
 public void Destroy()
 {
     _HorizontalLines.ForEach(x => { GameObject.Destroy(x.Line); GameObject.Destroy(x.BeatText); });
     _HorizontalLines.Clear();
     VerticalLines.ForEach(x => GameObject.Destroy(x));
     VerticalLines.Clear();
 }
示例#3
0
 private void ReadVerticalLines()
 {
     for (int i = 0; i < width; ++i)
     {
         for (int j = 0; j < height; ++j)
         {
             if (currentSource[j, i])
             {
                 Line line = GetVerticalLine(new Point(i + (preference.LineThicknes >> 1), j));
                 if (line.GetLength() > preference.FieldLenght * 1.5)
                 {
                     line.A.X = line.B.X = GetVerticalLineMidle(line);
                     VerticalLines.Add(line);
                     DestroyVerticalLine(line.A, line.B.Y - line.A.Y);
                 }
             }
         }
     }
 }
示例#4
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(120, 30);

            //Отрисовка рамки
            HorizontalLines upLine    = new HorizontalLines(0, 118, 0, '+');
            HorizontalLines downLine  = new HorizontalLines(0, 118, 29, '+');
            VerticalLines   leftLine  = new VerticalLines(0, 0, 29, '+');
            VerticalLines   rightLine = new VerticalLines(118, 0, 29, '+');

            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            //Отрисовка точек
            Point p     = new Point(4, 5, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Drow();
            snake.Move();
        }