Esempio n. 1
0
        public string GameNaam()
        {
            var lijst  = repoG.GetGameId(PlatformController.Platform);
            int lengte = lijst.Count;
            int i      = RandIdGen.CalcId(lengte);
            var GameId = lijst[i - 1].ToString();
            var start  = GameId.IndexOf("=");
            var last   = GameId.LastIndexOf("}");
            var span   = last - start;

            GameId = GameId.Substring(start + 1, span - 1);
            return(repoG.GetGame(PlatformController.Platform, int.Parse(GameId)).Title);
        }
Esempio n. 2
0
        public string PlatformNaam()
        {
            try
            {
                Platform = RandIdGen.CalcId(repo.GetNumOfPlatform());
                return(repo.GetPlatform(Platform).PlatformName);
            }
            catch
            {
                var rnd = new Random();

                if (rnd.Next() % 2 == 0)
                {
                    Platform++;
                }
                else
                {
                    Platform--;
                }

                return(repo.GetPlatform(Platform).PlatformName);
            }
        }