コード例 #1
0
 public Presenter(View view)
 {
     this.view = view;
     // Sample model
     this.model   = new Model(rows: 20, cols: 32);
     this.present = model.Create();
     // Sample data: The legendary glider
     model.Set(present, 3, 11, 1);
     model.Set(present, 4, 12, 1);
     model.Set(present, 5, 10, 1);
     model.Set(present, 5, 11, 1);
     model.Set(present, 5, 12, 1);
 }
コード例 #2
0
        public void Execute()
        {
            var future = model.Create();

            for (int i = 0; i < present.Length; i++)
            {
                for (int j = 0; j < present[i].Length; j++)
                {
                    future[i][j] = Process(i, j, present);
                }
            }
            view.Draw(future);
            present = future;
        }