Beispiel #1
0
        public Board(Game aGame, PictureBox mainBox, PictureBox killedWhiteBox, PictureBox killedBlackBox)
        {
            game      = aGame;
            container = mainBox;

            // Create ArrayList
            BlockList      = new ArrayList();
            WhitePieceList = new ArrayList();
            BlackPieceList = new ArrayList();

            // Create Block Factory
            bFactory = new BlockFactory();
            pFactory = new PieceFactory();

            // Create Positioner
            bPositioner = new BlockPositioner();

            // Block Drawer
            BoardDrawer = new BoardInitializer(this, BlockList, WhitePieceList, BlackPieceList, bFactory, pFactory, bPositioner);
            BoardDrawer.Initialize();

            // Killed Piece
            KilledPieceMgr = new KilledPieceManager(killedWhiteBox, killedBlackBox);

            // Create Decorator and assign events
            cbDecorator = new BoardDecorator(this, mainBox);

            PosCalculatorFactory = new PositionCalculatorFactory(this);
        }
Beispiel #2
0
 public BoardInitializer(Board aBoard, ArrayList aBlockList, ArrayList aWhitePieceList, ArrayList aBlackPieceList, BlockFactory aBlockFactory, PieceFactory aPieceFactory, BlockPositioner aBlockPositioner)
 {
     board          = aBoard;
     bList          = aBlockList;
     WhitePieceList = aWhitePieceList;
     BlackPieceList = aBlackPieceList;
     bFactory       = aBlockFactory;
     pFactory       = aPieceFactory;
     bPositioner    = aBlockPositioner;
 }