Esempio n. 1
0
 protected WorldEvent(int day, WorldEventImportance importance, WorldEventType type, string text)
 {
     this.day        = day;
     this.type       = type;
     this.importance = importance;
     this.text       = text;
 }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 public void UpdateLog()
 {
     if (panel.activeInHierarchy)
     {
         WorldEventImportance importance = (WorldEventImportance)importanceDropdown.value;
         worldLogText.text = GameController.World.log.GetLog(importance);
     }
 }
Esempio n. 4
0
 public TownCreationEvent(int day, WorldEventImportance importance, Town town
                          ) : base(day, importance, WorldEventType.TownCreation, $"{town} was created")
 {
 }