示例#1
0
        public PieceFactory(AbstractBlockFactory <ITetrisBlock> factory) : base(factory)
        {
            LPiece = GetPiece(2, new PointF(0.0f, 1.0f), Brushes.Gold, "101011");
            JPiece = GetPiece(2, new PointF(1.0f, 1.0f), Brushes.OrangeRed, "010111");
            OPiece = GetPiece(2, new PointF(0.5f, 0.5f), Brushes.Gray, "1111");
            IPiece = GetPiece(4, new PointF(1.5f, 0.5f), Brushes.SandyBrown, "1111");
            TPiece = GetPiece(3, new PointF(1.0f, 1.0f), Brushes.Indigo, "010111");
            SPiece = GetPiece(2, new PointF(0.0f, 1.0f), Brushes.ForestGreen, "101101");
            ZPiece = GetPiece(2, new PointF(0.0f, 1.0f), Brushes.DodgerBlue, "011110");

            Pieces = new List <IPiece>
            {
                OPiece, IPiece, TPiece, ZPiece, SPiece, LPiece, JPiece
            };
        }
示例#2
0
 public AbstractPieceFactory(AbstractBlockFactory <ITetrisBlock> factory)
 {
     Random   = new Random();
     _factory = factory;
 }