Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            gameView = new BoardView();
            gameView.Frame = new System.Drawing.RectangleF(0,0,960,640);
            scrollView = new UIScrollView();
            scrollView.AddSubview(gameView);
            scrollView.BackgroundColor = UIColor.DarkGray;
            scrollView.MaximumZoomScale = 1f;
            scrollView.MinimumZoomScale = .5f;
            scrollView.ViewForZoomingInScrollView = delegate{
                return gameView;
            };
            scrollView.ContentSize = gameView.Frame.Size;
            scrollView.SetZoomScale(.5f,false);
            BoardGame = new Game(gameView);

            this.View = scrollView;
            gameView.StartGame(new List<Card>{
                new Card{Value1 = "1",Value2 = "1"},
                new Card{Value1 = "2",Value2 = "2"},
                new Card{Value1 = "3",Value2 = "3"},
                new Card{Value1 = "4",Value2 = "4"},
                new Card{Value1 = "5",Value2 = "5"},
                new Card{Value1 = "6",Value2 = "6"},
                new Card{Value1 = "7",Value2 = "7"},
                new Card{Value1 = "8",Value2 = "8"},
                new Card{Value1 = "9",Value2 = "9"},
                new Card{Value1 = "10",Value2 = "10"},
                new Card{Value1 = "11",Value2 = "11"},
                new Card{Value1 = "12",Value2 = "12"},
                new Card{Value1 = "13",Value2 = "13"},
                new Card{Value1 = "14",Value2 = "14"},
                new Card{Value1 = "15",Value2 = "15"},
            });
        }
Пример #2
0
 public Game(BoardView gameView)
 {
     GameView = gameView;
     CurrentGame = this;
 }