示例#1
0
 public void AddPixel(CPixel pixel)
 {
     if (!Lines.ContainsKey(pixel.Y))
     {
         Lines[pixel.Y] = new CLine();
     }
     Lines[pixel.Y].Pixels.Add(pixel);
 }
示例#2
0
        CPixel TranslatePixelFromShapeToGame(CPixel shapePixel)
        {
            shapePixel.X = shapePixel.ShapeX * PixelSize + CurrenntShape.X;
            shapePixel.Y = shapePixel.ShapeY * PixelSize + CurrenntShape.Y;

            return shapePixel;
        }
示例#3
0
        void RegisterPixelColor(CPixel pixel, Color color)
        {
            if (m_tetrisGame.CurrenntShape.Pixels.Find(delegate(CPixel cp1)
            {
                return cp1.X == pixel.X && cp1.Y == pixel.Y;
            }) == null)
            {
                return;
            }

            if (m_mapPixleColors.ContainsKey(pixel))
            {
                m_mapPixleColors[pixel] = color;
            }
            else
            {
                m_mapPixleColors.Add(pixel, color);
            }
        }
示例#4
0
 bool IsPixelsCollapsed(CPixel what, CPixel with)
 {
     if (what.X + PixelSize > with.X && what.X + PixelSize <= with.X + PixelSize &&
         what.Y + PixelSize > with.Y && what.Y + PixelSize <= with.Y + PixelSize)
     {
         return true;
     }
     return false;
 }
示例#5
0
 Color GetPixelColor(CPixel pixel)
 {
     if (m_mapPixleColors.ContainsKey(pixel))
     {
         return m_mapPixleColors[pixel];
     }
     return Color.Red;
 }