public static void ClickButton(RouletteButtonKind buttonKind) { var targetButton = ApplicationViewModel.Instance.Settings.GetButton(buttonKind); if (targetButton == null) throw new ArgumentException(string.Format("Button {0} must be set!", buttonKind)); if (targetButton.IsPositionAbsolute) ClickAbsolute(targetButton.Position.Value); else Click(targetButton.Position.Value); }
private BetViewModel PlaceBet(BettingKind betKind, RouletteButtonKind betButtonKind, int streakCount, double amount = 0) { //TODO select correct bet amount button (when auto adjust is enabled) if (!Settings.IsBettingEnabled) return null; if (amount == 0) amount = Settings.DefaultBet.Amount.Value; if (amount < Settings.MinBetAmount) amount = Settings.MinBetAmount; else if (amount > Settings.MaxBetAmount) amount = Settings.MaxBetAmount; if (!Settings.IsSimulationMode) { RouletteBoardHelper.SetBet(Settings.DefaultBet); int betClicksToAmount = 1; if (amount > 0) betClicksToAmount = (int)(amount / Settings.DefaultBet.Amount.Value); for (int i = 0; i < betClicksToAmount; i++) { RouletteBoardHelper.ClickButton(betButtonKind); } } //int curStreakCount = GetOppositeStreakCount(betKind); double betAmount = amount == 0 ? Settings.DefaultBet.Amount.Value : amount; BetViewModel newBet = new BetViewModel(betKind, streakCount, Statistics.LastNumber.Value, betAmount, ApplicationViewModel.Instance.Session.ElapsedTime); Statistics.AddBetToHistory(newBet); return newBet; }
public CasinoButtonViewModel GetButton(RouletteButtonKind buttonKind) { return CasinoButtons.First(cur => cur.Kind == buttonKind); }