public MartingaleViewModel(DiceSite Site, AutomatedBetSettings settings) : base(Site) { StartCommand = new Command(async() => { stop = false; if (_onLose == 0) { _onLose = (BetMultiplier / (BetMultiplier - 1)) * 1.05m; } Strategy = new Martingale(_settings = settings); Strategy.Refresh += (obj, arg) => { RefreshValues(); }; await Strategy.Run(_site); }); StopCommand = new Command(() => Strategy.Stop()); MessagingCenter.Subscribe <DiceSite, string>(this, "error", (sender, args) => Strategy.Stop()); MessagingCenter.Subscribe <DiceSite, string>(this, "updateStatus", (sender, args) => Status = args); Title = "Martingale"; }
public AutomaticPlayPage(DiceSite Site, AutomatedBetSettings settings) : this() { BindingContext = viewmodel = new MartingaleViewModel(Site, settings); viewmodel.Title = _titleText; }
public PlayViewModel(DiceSite Site) { _site = Site; Bets = new ObservableCollection <Bet>(); BetHighCommand = new Command(async() => await _site.PlaceBet(true, BetAmount, BetChance)); BetLowCommand = new Command(async() => await _site.PlaceBet(false, BetAmount, BetChance)); MessagingCenter.Subscribe <DiceSite, decimal>(this, "updateBalance", (obj, val) => { OnPropertyChanged(nameof(Amount)); }); MessagingCenter.Subscribe <DiceSite, Bet>(this, "addBet", (obj, bet) => { Bets.Add(bet); }); MessagingCenter.Subscribe <DiceSite, string>(this, "updateStatus", (obj, message) => { Status = message; }); }
public LoginViewModel(DiceSite Site) { _site = Site; Title = String.Format("{0} login", Site.SiteTitle); SignIn = new Command(async() => await ExecuteLogin()); }
public BetSettingsPage(DiceSite Site) : this() { BindingContext = betSettings; _site = Site; }
public async Task <int> Run(DiceSite Site) { var currentAmount = _settings.BaseBet; bool bettingHigh = true; if (_settings.BetOn == BetOnEnum.Low) { bettingHigh = false; } while (CanExecute(Site)) { if (!await Site.PlaceBet(bettingHigh, currentAmount, _settings.Chance)) { // perdita if (_settings.BetAction_OnLose == BetResultAction.ReturnToBase) { currentAmount = _settings.BaseBet; } if (_settings.BetAction_OnLose == BetResultAction.Increase) { currentAmount *= (_settings.IncreaseAmount_OnLose / 100m + 1); } if (_settings.BetAction_OnLose == BetResultAction.ChangeOdds) { _settings.BetOdds = _settings.NewOdd_OnLose; } } else { // vincita if (_settings.BetAction_OnWin == BetResultAction.ReturnToBase) { currentAmount = _settings.BaseBet; } if (_settings.BetAction_OnWin == BetResultAction.Increase) { currentAmount *= (_settings.IncreaseAmount_OnWin / 100m + 1); } if (_settings.BetAction_OnWin == BetResultAction.ChangeOdds) { _settings.BetOdds = _settings.NewOdd_OnWin; } } if (_settings.BetOn == BetOnEnum.Alternate) { bettingHigh = !bettingHigh; } Refresh?.Invoke(this, EventArgs.Empty); } ; return(await Task <int> .FromResult(Site.wins - Site.losses)); }
public PlayPage(DiceSite Site) { #region Manual Bet Page var manualPage = new ManualPlayPage(Site); #endregion #region Automatic Bet Page var automaticPage = new AutomaticPlayPage(Site); #endregion Children.Add(manualPage); Children.Add(automaticPage); }
public MainPage(DiceSite connectedSite) { site = connectedSite; masterPage = new MasterPage(); Master = masterPage; Detail = new NavigationPage(new ManualPlayPage(site)); masterPage.ListView.ItemSelected += OnItemSelected; if (Device.RuntimePlatform == Device.UWP) { MasterBehavior = MasterBehavior.Popover; } }
public bool CanExecute(DiceSite Site) { if (_settings.ShouldStopOnProfit) { // Manage stop profit if (Site.profit >= _settings.StopOnProfit) { return(false); } } if (_settings.ShouldStopOnLoss && Site.profit < 0) { if (Math.Abs(Site.profit) >= _settings.StopOnLoss) { return(false); } } if (AreRollsLimited && _settings.Rolls-- <= 0) { return(false); } return(!stop); }
public DisconnectPage(DiceSite site) { InitializeComponent(); BindingContext = new DisconnectViewModel(); _site = site; }
public ManualPlayPage(DiceSite Site) : this() { BindingContext = viewmodel = new PlayViewModel(Site); viewmodel.Title = _titleText; }
protected BaseDetailPage(DiceSite Site) { site = Site; }
public LoginPage(DiceSite Site) : this() { BindingContext = viewmodel = new LoginViewModel(Site); }
public MartingalePage(DiceSite Site) : this() { //BindingContext = viewmodel = new MartingaleViewModel(Site); }