private static AppState SimulatePastTicks(AppState appState, IReadOnlyCollection <string> purchasedUpgradeIds) { var(interval, numberOfPastTicks) = GetSimulationParameters(appState); var faithGain = 0d; var moneyGain = 0d; for (var i = 0; i < numberOfPastTicks; i++) { if (appState.Followers != 0) { faithGain += TimerService.ToTickValue(UpgradeEffectsSelectorHelper.SelectFaithPerFollowerIncrease(purchasedUpgradeIds) * appState.Followers, interval); moneyGain += TimerService.ToTickValue(UpgradeEffectsSelectorHelper.SelectMoneyPerFollowerIncrease(purchasedUpgradeIds) * appState.Followers, interval); } } return(appState with { Faith = appState.Faith + faithGain, Money = appState.Money + moneyGain, Timestamp = DateTime.Now }); }