Ejemplo n.º 1
0
        public Render(ITurnDataModel dataModel, System.Windows.Forms.PictureBox pictureBox, IDrawer drawer)
        {
            this.PICTURE_BOX = pictureBox;
            this.DRAWER      = drawer;

            registerMoreDrawer(drawer);

            this.dataModel     = dataModel;
            pictureBox.Resize += (sender, args) => drawTurn();

            BULLET_DELEGATE = (bullet, g, turn) => DRAWER.DrawExplodedBullet(bullet, g, turn);
            MINE_DELEGATE   = (mine, g, turn) => DRAWER.DrawExplodedMine(mine, g, turn);
            REPAIR_DELEGATE = (repair, g, turn) => DRAWER.DrawRepair(repair, g, turn);
            SCAN_DELEGATE   = (scan, g, turn) => DRAWER.DrawScan(scan, g, turn);
        }
Ejemplo n.º 2
0
 public BattlefieldViewer(ITurnDataModel turnDataModel)
 {
     InitializeComponent();
     render = new Render(turnDataModel, pictureBox1, new DefaultDrawer());
 }