public void ReplaceShareholder(int newId, string newName, InvestorType newInvestorType) { var index = GameComponentsLookup.Shareholder; var component = (ShareholderComponent)CreateComponent(index, typeof(ShareholderComponent)); component.Id = newId; component.Name = newName; component.InvestorType = newInvestorType; ReplaceComponent(index, component); }
public static int BecomeInvestor(GameContext context, GameEntity e, long money) { int investorId = GenerateInvestorId(context); string name = "Investor?"; InvestorType investorType = InvestorType.VentureInvestor; // company if (e.hasCompany) { name = e.company.Name; if (e.company.CompanyType == CompanyType.FinancialGroup) { investorType = InvestorType.VentureInvestor; } else { investorType = InvestorType.Strategic; } } else if (e.hasHuman) { // or human // TODO turn human to investor name = e.human.Name + " " + e.human.Surname; investorType = InvestorType.Founder; } if (!e.hasCompanyResource) { e.AddCompanyResourceHistory(new System.Collections.Generic.List <ResourceTransaction>()); e.AddCompanyResource(new TeamResource()); } e.AddShareholder(investorId, name, investorType); e.AddOwnings(new System.Collections.Generic.List <int>()); if (!e.hasCorporateCulture) { e.AddCorporateCulture(Companies.GetFundCorporateCulture()); } Companies.SetResources(e, money, "Become investor"); return(investorId); }
void AddLinkToInvestorIfPossible(InvestorType investorType) { switch (investorType) { case InvestorType.Angel: case InvestorType.Founder: gameObject.AddComponent <LinkToHuman>().SetHumanId(shareholder.human.Id); break; case InvestorType.Strategic: case InvestorType.VentureInvestor: gameObject.AddComponent <LinkToProjectView>().CompanyId = shareholder.company.Id; break; } }
public static int BecomeInvestor(GameContext context, GameEntity e, long money) { int investorId = GenerateInvestorId(context); string name = "Investor?"; InvestorType investorType = InvestorType.VentureInvestor; // company if (e.hasCompany) { name = e.company.Name; if (e.company.CompanyType == CompanyType.FinancialGroup) { investorType = InvestorType.VentureInvestor; } else { investorType = InvestorType.Strategic; } } else if (e.hasHuman) { // or human // TODO turn human to investor name = e.human.Name + " " + e.human.Surname; investorType = InvestorType.Founder; if (!e.hasCompanyResource) { e.AddCompanyResource(new Core.TeamResource(money)); } } e.AddShareholder(investorId, name, investorType); if (!e.hasCorporateCulture) { e.AddCorporateCulture(Companies.GetFundCorporateCulture()); } AddMoneyToInvestor(context, investorId, money); return(investorId); }
public static bool IsInvestorSuitableByGoal(InvestorType shareholderType, InvestorGoal goal) { switch (goal) { case InvestorGoal.BecomeMarketFit: return(shareholderType == InvestorType.Angel); case InvestorGoal.BecomeProfitable: return(shareholderType == InvestorType.VentureInvestor); case InvestorGoal.GrowCompanyCost: return(shareholderType == InvestorType.VentureInvestor || shareholderType == InvestorType.Strategic); case InvestorGoal.IPO: return(shareholderType == InvestorType.Strategic || shareholderType == InvestorType.VentureInvestor); case InvestorGoal.Prototype: case InvestorGoal.FirstUsers: default: return(shareholderType == InvestorType.FFF); } }
public static long GetDesireToSellStartupByInvestorType(GameEntity startup, InvestorType investorType, int shareholderId, GameContext gameContext) { switch (investorType) { case InvestorType.Angel: case InvestorType.FFF: case InvestorType.VentureInvestor: return(OnGoalCompletion(startup, investorType)); case InvestorType.StockExchange: return(GetStockExhangeTradeDesire(startup, shareholderId)); case InvestorType.Founder: return(GetFounderExitDesire(startup, shareholderId, gameContext)); case InvestorType.Strategic: return(GetStrategicInvestorExitDesire(startup, shareholderId, gameContext)); default: Debug.Log("GetDesireToSellStartupByInvestorType. Unknown investor type " + investorType.ToString()); return(Balance.COMPANY_DESIRE_TO_SELL_NO); } }
public static string GetSellRejectionDescriptionByInvestorType(InvestorType investorType, GameEntity company) { if (IsYoungCompany(company)) { return("It's too early to sell company"); } switch (investorType) { case InvestorType.Angel: case InvestorType.FFF: case InvestorType.VentureInvestor: return("Company goals are not completed"); case InvestorType.Founder: return("Founder ambitions not fulfilled"); case InvestorType.Strategic: return("Views this company as strategic"); default: return(investorType.ToString() + " will not sell shares"); } }
public static long OnGoalCompletion(GameEntity startup, InvestorType investorType) { bool goalCompleted = !Investments.IsInvestorSuitableByGoal(investorType, startup.companyGoal.InvestorGoal); return(goalCompleted ? Balance.COMPANY_DESIRE_TO_SELL_YES : Balance.COMPANY_DESIRE_TO_SELL_NO); }
public static bool IsWantsToSellShares(GameEntity company, GameContext gameContext, int investorId, InvestorType investorType) { var desire = GetBaseDesireToSellShares(gameContext, company, investorId, investorType); return(true); return(desire > 0); }
public static long GetBaseDesireToSellShares(GameContext gameContext, GameEntity company, int shareholderId, InvestorType investorType) { bool isProduct = company.hasProduct; var bonusContainer = new Bonus <long>("Desire to sell"); bonusContainer.Append("Base", 5); //bonusContainer.Append("Base", -1); //bonusContainer.AppendAndHideIfZero("Is young company", IsYoungCompany(company) ? -10 : 0); //if (isProduct) // bonusContainer.AppendAndHideIfZero("By investor type", GetDesireToSellStartupByInvestorType(company, investorType, shareholderId, gameContext)); //else // bonusContainer.AppendAndHideIfZero("By investor type", GetDesireToSellGroupByInvestorType(company, investorType, shareholderId, gameContext)); return((long)bonusContainer.Sum()); }
public static long GetDesireToSellGroupByInvestorType(GameEntity group, InvestorType investorType, int shareholderId, GameContext gameContext) { return(group.isPublicCompany ? 1 : 0); }