Ejemplo n.º 1
0
        public GetBet(GameServant g, UI_Sketch ui)
        {
            InitializeComponent();
            this.Title += String.Format(" ({0} available)", g.PlayerFunds.Substring(7));
            t = new System.Timers.Timer(100);
            t.Elapsed += t_Elapsed;
            game = g;
            if (ui != null) {
                ui.csDealerNormal.Cards.Clear();
                ui.csPlayerNormal.Cards.Clear();
                ui.csPlayerSplit.Cards.Clear();
                ui.btnNormalHit.IsEnabled = false;
                ui.btnNormalStand.IsEnabled = false;
                ui.paint();
                ui.Visibility = System.Windows.Visibility.Visible;
            }
            if (Application.Current != null) {
                Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Background, new Action(delegate {
                }));
            }
            this.ShowDialog();

            Binding bind = new Binding("IsNormalActive");
            bind.Source = game;
            ui.btnNormalHit.SetBinding(Button.IsEnabledProperty, bind);
            ui.btnNormalStand.SetBinding(Button.IsEnabledProperty, bind);

            txtBet.Focus();
            //t.Start();
        }
Ejemplo n.º 2
0
 public void init()
 {
     this.Visibility = System.Windows.Visibility.Hidden;
     game = new GameServant(god_mode);
     this.DataContext = game;
     game.ActiveHand = GameServant.ActiveHandPotentials.None;
     game.NotifyAll();
     newr();
     paint();
     this.Visibility = System.Windows.Visibility.Visible;
 }
Ejemplo n.º 3
0
 public GetUserName(GameServant g)
     : this()
 {
     game = g;
 }