public void AddPixel(CPixel pixel) { if (!Lines.ContainsKey(pixel.Y)) { Lines[pixel.Y] = new CLine(); } Lines[pixel.Y].Pixels.Add(pixel); }
CPixel TranslatePixelFromShapeToGame(CPixel shapePixel) { shapePixel.X = shapePixel.ShapeX * PixelSize + CurrenntShape.X; shapePixel.Y = shapePixel.ShapeY * PixelSize + CurrenntShape.Y; return shapePixel; }
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); } }
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; }
Color GetPixelColor(CPixel pixel) { if (m_mapPixleColors.ContainsKey(pixel)) { return m_mapPixleColors[pixel]; } return Color.Red; }