public string StickTraderWillGive(string stickName) { string traderName = levelConfigManager.Value.LevelTraderName(); string traderOneTrueStickName = TraderConfigManager.OneTrueStickForTrader(traderName); string traderOneTrueStickReward = TraderConfigManager.StickGivenForOneTrueStick(traderName); string traderOtherStickReward = TraderConfigManager.StickGivenForOtherStick(traderName); string stickTraderWillGive = traderOneTrueStickName == stickName ? traderOneTrueStickReward : traderOtherStickReward; return(stickTraderWillGive); }
public EndingType CurrentGameEndingType() { IEnumerable <string> startingSticks = StickConfigs.Where(config => config.startingStick).Select(config => config.name).ToArray(); IEnumerable <string> oneTrueStickTradeResults = TraderConfigManager.OneTrueStickTradeResult(); string[] currentSticks = CurrentInventoryStickNames(); IEnumerable <string> sticksLeftFromStartOfGame = currentSticks.Intersect(startingSticks); IEnumerable <string> sticksObtainedInExchangeForOneTrueStick = currentSticks.Intersect(oneTrueStickTradeResults); if (sticksObtainedInExchangeForOneTrueStick.ToArray().Length >= 4) { return(EndingType.ThirdEnding); } return(sticksLeftFromStartOfGame.ToArray().Length < 5 ? EndingType.SecondEnding : EndingType.FirstEnding); }