Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.CreateGame);
            var createGamebutton = FindViewById <Android.Widget.Button>(Resource.Id.startgame);

            createGamebutton.Click += delegate
            {
                var    blindhelper = new BlindsHelper();
                var    players     = FindViewById <Android.Widget.EditText>(Resource.Id.numberofplayers);
                var    hours       = FindViewById <Android.Widget.EditText>(Resource.Id.numberofhours);
                double hoursD;
                double playersD;

                var hoursValid           = double.TryParse(hours.Text, out hoursD);
                var numberofplayersValid = double.TryParse(players.Text, out playersD);
                if (hoursValid && numberofplayersValid)
                {
                    var timeinMS  = blindhelper.GetBlindTimeInMS(hoursD, playersD);
                    var timeinMin = timeinMS / 1000 / 60;
                    //var resulttext = FindViewById<Android.Widget.TextView>(Resource.Id.timeperblindtext);
                    //resulttext.Text = timeinMin + " minutes";
                }
            };

            // Create your application here
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.CreateGame);
            var createGamebutton = FindViewById<Android.Widget.Button>(Resource.Id.startgame);
            createGamebutton.Click += delegate
            {
                var blindhelper = new BlindsHelper();
                var players = FindViewById<Android.Widget.EditText>(Resource.Id.numberofplayers);
                var hours = FindViewById<Android.Widget.EditText>(Resource.Id.numberofhours);
                double hoursD;
                double playersD;

                var hoursValid = double.TryParse(hours.Text, out hoursD);
                var numberofplayersValid = double.TryParse(players.Text, out playersD);
                if (hoursValid && numberofplayersValid)
                {
                    var timeinMS = blindhelper.GetBlindTimeInMS(hoursD, playersD);
                    var timeinMin = timeinMS/1000/60;
                    //var resulttext = FindViewById<Android.Widget.TextView>(Resource.Id.timeperblindtext);
                    //resulttext.Text = timeinMin + " minutes";
                }

            };

            // Create your application here
        }
Пример #3
0
 public Game(double buyin, int numberOfPlayers, double numberOfHours)
 {
     var blindhelper = new BlindsHelper();
     TimeperblindMS = blindhelper.GetBlindTimeInMS(numberOfHours, numberOfPlayers);
     //var timeinMin = TimeperblindMS / 1000 / 60;
     var prizePools = new Priezepools();
     PrizePool = prizePools.Prizeppols.FirstOrDefault(p => p.minPlayers <= numberOfPlayers && p.maxPlayers >= numberOfPlayers);
     if (PrizePool != null)
     {
         PrizePool.SUM = buyin * numberOfPlayers;
         AvarageStack = PrizePool.SUM / numberOfPlayers;
         Blinds = BlindsHelper.Blinds.Take(BlindsHelper.maxBBindex).ToArray();
         CurrentBlind = Blinds[0];
     }
 }
Пример #4
0
        public Game(double buyin, int numberOfPlayers, double numberOfHours)
        {
            var blindhelper = new BlindsHelper();

            TimeperblindMS = blindhelper.GetBlindTimeInMS(numberOfHours, numberOfPlayers);
            //var timeinMin = TimeperblindMS / 1000 / 60;
            var prizePools = new Priezepools();

            PrizePool = prizePools.Prizeppols.FirstOrDefault(p => p.minPlayers <= numberOfPlayers && p.maxPlayers >= numberOfPlayers);
            if (PrizePool != null)
            {
                PrizePool.SUM = buyin * numberOfPlayers;
                AvarageStack  = PrizePool.SUM / numberOfPlayers;
                Blinds        = BlindsHelper.Blinds.Take(BlindsHelper.maxBBindex).ToArray();
                CurrentBlind  = Blinds[0];
            }
        }