void SendMoney(GameEntity product, GameEntity managingCompany, long sum) { var date = ScheduleUtils.GetCurrentDate(gameContext); var goal = new InvestmentGoalUnknown(InvestorGoalType.GrowCompanyCost); var proposal = new InvestmentProposal { Investment = new Investment(sum, 1, goal, date), AdditionalShares = 0, ShareholderId = managingCompany.shareholder.Id, WasAccepted = false, }; Companies.AddInvestmentProposal(product, proposal); Companies.AcceptInvestmentProposal(gameContext, product, managingCompany); }
public static InvestmentGoal GetInvestmentGoal(GameEntity company, GameContext gameContext, InvestorGoalType goalType) { var income = Economy.GetIncome(gameContext, company); var unknown = new InvestmentGoalUnknown(goalType); var strongerOpponent = Companies.GetStrongerCompetitor(company, gameContext, true); var weakerOpponent = Companies.GetWeakerCompetitor(company, gameContext, true); if (goalType == InvestorGoalType.OutcompeteCompanyByIncome || goalType == InvestorGoalType.OutcompeteCompanyByCost || goalType == InvestorGoalType.OutcompeteCompanyByUsers) { if (strongerOpponent == null) { return(unknown); } } if (goalType == InvestorGoalType.AcquireCompany) { if (weakerOpponent == null) { return(unknown); } } NicheType MainMarket = company.companyFocus.Niches[0]; switch (goalType) { case InvestorGoalType.ProductPrototype: return(new InvestmentGoalMakePrototype()); case InvestorGoalType.ProductFirstUsers: return(new InvestmentGoalFirstUsers(5_000)); case InvestorGoalType.ProductMillionUsers: return(new InvestmentGoalMillionUsers(1_000_000)); case InvestorGoalType.ProductBecomeMarketFit: return(new InvestmentGoalMakeProductMarketFit()); case InvestorGoalType.ProductRelease: return(new InvestmentGoalRelease()); case InvestorGoalType.ProductPrepareForRelease: return(new InvestmentGoalPrepareForRelease()); case InvestorGoalType.ProductStartMonetising: return(new InvestmentGoalStartMonetisation()); case InvestorGoalType.ProductRegainLoyalty: return(new InvestmentGoalRegainLoyalty()); case InvestorGoalType.BecomeProfitable: return(new InvestmentGoalBecomeProfitable(income)); case InvestorGoalType.GrowIncome: return(new InvestmentGoalGrowProfit(Economy.GetIncome(gameContext, company) * 3 / 2)); case InvestorGoalType.GrowUserBase: return(new InvestmentGoalGrowAudience(Marketing.GetUsers(company) * 2)); case InvestorGoalType.GrowCompanyCost: return(new InvestmentGoalGrowCost(Economy.CostOf(company, gameContext) * 2)); //case InvestorGoalType.GainMoreSegments: return new InvestmentGoalMoreSegments (Marketing.GetAmountOfTargetAudiences(company) + 1); case InvestorGoalType.OutcompeteCompanyByIncome: return(new InvestmentGoalOutcompeteByIncome(strongerOpponent.company.Id, strongerOpponent.company.Name)); case InvestorGoalType.OutcompeteCompanyByUsers: return(new InvestmentGoalOutcompeteByUsers(strongerOpponent.company.Id, strongerOpponent.company.Name)); case InvestorGoalType.OutcompeteCompanyByCost: return(new InvestmentGoalOutcompeteByCost(strongerOpponent.company.Id, strongerOpponent.company.Name)); case InvestorGoalType.AcquireCompany: return(new InvestmentGoalAcquireCompany(weakerOpponent.company.Id, weakerOpponent.company.Name)); case InvestorGoalType.DominateMarket: return(new InvestmentGoalDominateMarket(MainMarket)); case InvestorGoalType.BuyBack: return(new InvestmentGoalBuyBack()); case InvestorGoalType.Operationing: return(new InvestmentGoalGrowProfit(Economy.GetIncome(gameContext, company) * 3 / 2)); default: return(unknown); } }