public static void PrintYearStatsSummary() { string text = ""; Data.YearData lastYear = Data.DataContainer.GetLastYearData(); text += "Insight" + Environment.NewLine; text += "<color=yellow>------------</color>" + Environment.NewLine; text += Data.Extrapolater.GetInsightForYear(Data.DataContainer.GetLastYearData()); text += "<color=yellow>------------</color>" + Environment.NewLine; text += "Stats Summary" + Environment.NewLine; text += "<color=yellow>------------</color>" + Environment.NewLine; text += Data.Extrapolater.exp_FoodInsufficiency(lastYear); text += Data.Extrapolater.exp_FoodProductionCurrent(); text += Data.Extrapolater.exp_FoodProductionMax(); text += "<color=yellow>------------</color>"; DebugExt.Log(text); }
public static void PrintYearStatsSummary() { string text = ""; text += "Insight" + Environment.NewLine; text += "<color=yellow>-------</color>" + Environment.NewLine; text += Data.Extrapolater.GetInsightForYear(Data.DataContainer.GetLastYearData()); text += "<color=yellow>-------</color>" + Environment.NewLine; text += "Stats Summary" + Environment.NewLine; text += "<color=yellow>------------</color>" + Environment.NewLine; text += "Food insufficiency last year: " + Data.Analyzer.GetRequiredFoodForYear(Data.DataContainer.GetLastYearData()).ToString() + Environment.NewLine; text += "Estimated Food insufficiency for " + Data.Analytics.GetPlayerKingdomPopulation().ToString() + " people: " + Data.Analyzer.GetEstimatedFoodInsufficiencyForPeople(Data.Analytics.GetPlayerKingdomPopulation(), Data.DataContainer.GetAllYearData()).ToString() + Environment.NewLine; text += "Estimated Food insufficiency for " + Data.Analytics.GetHousingForKingdom().ToString() + " people: " + Data.Analyzer.GetEstimatedFoodInsufficiencyForPeople(Data.Analytics.GetHousingForKingdom(), Data.DataContainer.GetAllYearData()).ToString() + Environment.NewLine; text += "<color=yellow>------------</color>"; DebugExt.Log(text); }
public static void HandleException(Exception ex) { if (Debug) { DebugExt.Log(ex.Message + "\n" + ex.StackTrace); } else { helper.Log(ex.Message + "\n" + ex.StackTrace); } }
static void Postfix() { try { Data.DataContainer.OnYearEnd(); Mod.OnYearEnd(); } catch (Exception ex) { DebugExt.HandleException(ex); } }
void Update() { if (Settings.debug) { if (Input.GetKeyDown(Settings.keycode_yearSummary)) { try { PrintYearStatsSummary(); } catch (Exception ex) { DebugExt.HandleException(ex); } } } }