Esempio n. 1
0
        /// <summary>
        /// Displayviews this instance.
        /// </summary>
        private void displayview()
        {
            viewGames = new ObservableCollection <ViewGame>();
            var app = Application.Current as App;

            var fraction = app.fractionmax;


            foreach (var game in games)
            {
                var cid = game.catid;

                var pid = game.pid;

                var work = new ViewGame();

                work.Time = game.time;
                var cat = categories.Single(cm => cm.catid == cid).catname;
                work.category = cat;
                work.player   = players.Single(p => p.pid == pid).ToString();

                work.lenght = Convert.ToString(game.lenth) + " " + Convert.ToString(game.fraction) + "/" +
                              fraction.ToString() + " ";

                viewGames.Add(work);
            }
            winnerListView.ItemsSource = viewGames;
        }
Esempio n. 2
0
        public void getDecksForGameTest()
        {
            var gameRepositoryMock = new GameRepositoryMock();
            var viewGame           = new ViewGame(gameRepositoryMock);

            var returnObject = viewGame.getDecksForGame(0);
            var expected     = new Collection <CarddeckEntity>();

            Assert.AreEqual(expected.GetType(), returnObject.GetType());
        }
Esempio n. 3
0
        public void getAllGamesTest()
        {
            var gameRepositoryMock = new GameRepositoryMock();
            var viewGame           = new ViewGame(gameRepositoryMock);

            var returnObject = viewGame.getAllGames();
            var expected     = new Collection <GameEntity>();

            Assert.AreEqual(expected.GetType(), returnObject.GetType());
        }
Esempio n. 4
0
        public void getGameByIdTest()
        {
            var gameRepositoryMock = new GameRepositoryMock();
            var viewGame           = new ViewGame(gameRepositoryMock);

            var returnObject = viewGame.getGameById(2);
            var expected     = new GameEntity(0, "Test");

            Assert.AreEqual(expected.GetType(), returnObject.GetType());
        }
Esempio n. 5
0
        private void glControl1_Load(object sender, EventArgs e)
        {
            OpenTK.Graphics.OpenGL.GL.Enable(EnableCap.Texture2D);
            Application.Idle += Application_Idle;
            loaded            = true;
            GL.ClearColor(Color.SkyBlue);

            //GL.Enable(EnableCap.Texture2D);

            tileset = ContentPipe.LoadTexture("Tiles.png");
            view    = new ViewGame(Vector2.Zero, 0.5f, 0);
            level   = new Level("../../../GameLogic/Content/LevelOneNew.json");
            //var mouse = Mouse.GetState();
            // Input.Initialize(this);


            glControl1.MouseDown += GlControl1_MouseDown;
        }
Esempio n. 6
0
 void Awake()
 {
     sharedInstance = this;
 }