void TakeInvestments(GameEntity company) { if (IsHasMoneyOverflow(company)) { return; } Companies.StartInvestmentRound(company, gameContext); if (!Companies.IsInvestmentRoundStarted(company)) { return; } var companyId = company.company.Id; var suitableProposals = Companies.GetInvestmentProposals(gameContext, companyId) .Where(InvestorIsNotRelatedToPlayer) .Where(p => !IsTargetInvestsInInvestorItself(p, company)); foreach (var s in suitableProposals) { var investorShareholderId = s.ShareholderId; Companies.AcceptInvestmentProposal(gameContext, companyId, investorShareholderId); //var shareholderName = Companies.GetInvestorName(gameContext, investorShareholderId); //Format.Print($"Took investments from {shareholderName}. Offer: {Format.Money(s.Offer)}", company); } }
public override void Execute() { var investor = Companies.GetInvestorById(Q, InvestorId); Companies.AcceptInvestmentProposal(Q, MyCompany, investor); Navigate(ScreenMode.InvesmentProposalScreen); //ReNavigate(); }
void SendMoney(GameEntity product, GameEntity managingCompany, long sum) { var proposal = new InvestmentProposal { Offer = sum, ShareholderId = managingCompany.shareholder.Id, InvestorBonus = InvestorBonus.None, Valuation = 0, WasAccepted = false }; Companies.AddInvestmentProposal(gameContext, product.company.Id, proposal); Companies.AcceptInvestmentProposal(gameContext, product.company.Id, managingCompany.shareholder.Id); }
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); }
void TakeInvestments(GameEntity company) { // spawning proposals Companies.StartInvestmentRound(gameContext, company); if (!Companies.IsInvestmentRoundStarted(company)) { return; } foreach (var s in Companies.GetInvestmentProposals(company)) { var investorShareholderId = s.ShareholderId; var investor = Companies.GetInvestorById(gameContext, investorShareholderId); Companies.AcceptInvestmentProposal(gameContext, company, investor); } }
public override void Execute() { int companyId = SelectedCompany.company.Id; var c = MyGroupEntity; long Offer = c.companyResource.Resources.money * Percent / 100; int shareholderId = MyGroupEntity.shareholder.Id; Companies.AddInvestmentProposal(Q, companyId, new InvestmentProposal { ShareholderId = shareholderId, Valuation = 0, Offer = Offer, WasAccepted = false, InvestorBonus = InvestorBonus.None }); Companies.AcceptInvestmentProposal(Q, companyId, shareholderId); }
public override void Execute() { Companies.AcceptInvestmentProposal(Q, SelectedCompany.company.Id, InvestorId); //ReNavigate(); }