Example #1
0
        private void BuyInvestorEffectiveness(UpgradeData vm, int id)
        {
            var perc = vm.Value / 100.0f;
            IInvestorService investorService = GameServices.Instance.InvestorService;

            investorService.AddEffectiveness((float)perc);
            GlobalRefs.LevelManager.AddXP(XPSources.BuyUpgrade);
        }
Example #2
0
 public Investor(IInvestorService investorService)
     : this()
 {
     this.InvestorService = investorService;
 }
Example #3
0
 public static void OnInvestorTriesChanged(IInvestorService sender, InvestorTriesChangedEventArgs args)
 => InvestorTriesChanged?.Invoke(sender, args);
 public DeleteInvestorHandler(IInvestorService investorService)
 {
     _investorService = investorService;
 }
 public CreateInvestorHandler(IInvestorService investorService)
 {
     _investorService = investorService;
 }
Example #6
0
 public InvestorsController(IInvestorService investorService, IMapper mapper)
 {
     _investorService = investorService;
     _mapper          = mapper;
 }
 public InvestorsController(ICommandDispatcher commandDispatcher,
                            IInvestorService investorService) : base(commandDispatcher)
 {
     _investorService = investorService;
 }
Example #8
0
 public DeleteFavouriteCompanyHandler(IInvestorService investorService)
 {
     _investorService = investorService;
 }
 public UserWithInvestorBuilder(IUserService userService, ILogger <InputDataBuilder> logger,
                                IInvestorService investorService)
     : base(userService, logger)
 {
     _investorService = investorService;
 }
 public InvestorsController(IInvestorService investorService, IMapper mapper)
 {
     this.investorService = investorService;
     this.mapper          = mapper;
 }
 public InvestorsController(IInvestorService investorService)
 {
     _investorService = investorService;
 }
 public InvestorApiController(IInvestorService service)
 {
     _service = service;
 }
Example #13
0
        private System.Collections.IEnumerator UpdateOnResumeImpl()
        {
            Services.GetService <IConsoleService>()?.AddOnScreenText("UpdateOnResumeImpl() generation service...");

            yield return(new WaitUntil(() => IsLoaded && Services.ResourceService.IsLoaded));

            yield return(new WaitUntil(() => Services.TransportService.IsLoaded && Services.PlayerService.IsLoaded && Services.TimeChangeService.IsLoaded));

            yield return(new WaitUntil(() => Services.InvestorService.IsLoaded));

            yield return(new WaitUntil(() => Services.GetService <ISleepService>().IsRunning));

            yield return(new WaitUntil(() => Player.LegacyPlayerData != null));

            ITransportUnitsService unitService     = Services.TransportService;
            IInvestorService       investorService = Services.InvestorService;
            ISleepService          sleepService    = Services.GetService <ISleepService>();
            IPlayerService         playerService   = Services.PlayerService;


            int interval = sleepService.SleepInterval;

            TotalOfflineBalance = 0.0;

            //clear expired timed boosts
            Generators.ClearExpiredBoosts(TimeService.UnixTimeInt);

            foreach (GeneratorInfo generator in Generators.PlanetGenerators)
            {
                if (generator.State == GeneratorState.Active)
                {
                    ProfitResult profitResult = generator.ConstructProfitResult(Generators);

                    if (generator.IsAutomatic)
                    {
                        TotalOfflineBalance += generator.UpdateAutomaticAfterSleep(interval, Generators);
                    }
                    else if (generator.IsManual && generator.IsGenerationStarted)
                    {
                        generator.AddGenerateTimer(interval);
                        if (generator.GenerateTimer >= profitResult.GenerationInterval)
                        {
                            generator.SetGenerateTimer(0);
                            generator.SetGenerationStarted(false);
                            playerService.AddGenerationCompanyCash(profitResult.ValuePerRound);
                            // UDebug.Log($"added to planet manual generator => {generator.GeneratorId} after sleep => {interval} seconds, value => {profitResult.ValuePerRound}".Colored(ConsoleTextColor.orange).Bold());
                            TotalOfflineBalance += profitResult.ValuePerRound;
                        }
                    }
                }
            }

            foreach (GeneratorInfo generator in Generators.NormalGenerators)
            {
                if (generator.State == GeneratorState.Active)
                {
                    ProfitResult profitResult = generator.ConstructProfitResult(Generators);

                    if (generator.IsAutomatic)
                    {
                        TotalOfflineBalance += generator.UpdateAutomaticAfterSleep(interval, Generators);
                        //UDebug.Log($"added to normal automatic generator => {generator.GeneratorId} after sleep => {interval} seconds, value => {value}".Colored(ConsoleTextColor.orange).Bold());
                    }
                    else if (generator.IsManual && generator.IsGenerationStarted)
                    {
                        UDebug.Log($"manul gen =>{generator.GeneratorId} sleep update".Colored(ConsoleTextColor.green).Bold());
                        generator.AddGenerateTimer(interval);
                        if (generator.GenerateTimer >= profitResult.GenerationInterval)
                        {
                            generator.SetGenerateTimer(0);
                            generator.SetGenerationStarted(false);
                            generator.SetAccumulatedCash(0);
                            playerService.AddGenerationCompanyCash(profitResult.ValuePerRound);
                            TotalOfflineBalance += profitResult.ValuePerRound;
                            generator.FireProgressEvent();
                            UDebug.Log($"added to normal manual generator => {generator.GeneratorId} after sleep => {interval} seconds, value => {profitResult.ValuePerRound}".Colored(ConsoleTextColor.orange).Bold());
                        }
                        //
                        //generator.Update(interval, Generators);
                    }
                }
            }
            //Services?.GetService<IConsoleService>()?.AddOnScreenText($"Added to company cash => {TotalOfflineBalance}");
            IsResumed = true;
        }
Example #14
0
 static InvestorService()
 {
     Instance = new InvestorService();
 }