public TetrisView() { InitializeComponent(); ViewSetting(); this.tm = new TetrisModel(this); this.tc = new TetrisController(this); finish_flag = false; nowBlock = null; nextBlock = null; initialCubesOnShow = new System.Windows.Forms.PictureBox[12]; initialCubesOnShow = GetWantedBlockOnShow(); initialCubesOnNext = new System.Windows.Forms.PictureBox[12]; initialCubesOnNext = GetWantedBlockOnNext(); tc.start(); }
// be inform the state is changed, then modify the model to new model public void stateHasChanged(TetrisModel model) { tm = model; }
public TetrisController(TetrisView tv) { this.tv = tv; this.tm = new TetrisModel(tv); }