protected WorldEvent(int day, WorldEventImportance importance, WorldEventType type, string text) { this.day = day; this.type = type; this.importance = importance; this.text = text; }
public string GetLog(WorldEventImportance minImportance) { string str = ""; for (int day = 0; day <= world.Days; day++) { bool eventFound = false; foreach (WorldEvent worldEvent in events) { if (worldEvent.day == day && worldEvent.importance >= minImportance) { if (!eventFound) { str += $"On {GetDay(day)},"; eventFound = true; } str += $" {worldEvent.text},"; } } if (eventFound) { str = str.Remove(str.Length - 1); str += ".\n"; } } return(str); }
public void UpdateLog() { if (panel.activeInHierarchy) { WorldEventImportance importance = (WorldEventImportance)importanceDropdown.value; worldLogText.text = GameController.World.log.GetLog(importance); } }
public TownCreationEvent(int day, WorldEventImportance importance, Town town ) : base(day, importance, WorldEventType.TownCreation, $"{town} was created") { }