/* * //konstruktor * //in: headline, author, zeitung, datum und ort als string. * //wahrheitswert ob news fake ist oder nicht. * //rossort (politik, wissenschaft und so) * //error string noch nicht herausgefunden * public News(string headline, * string author, * string newspaper, * string date, * string location, * string ressort, * Inconsistency conflict){ * * info.Add(InfoType.headline, new Info(InfoType.headline, headline)); * info.Add(InfoType.author, new Info(InfoType.author, author)); * info.Add(InfoType.paper, new Info(InfoType.paper, newspaper)); * info.Add(InfoType.date, new Info(InfoType.date, date)); * info.Add(InfoType.place, new Info(InfoType.place, location)); * info.Add(InfoType.ressort, new Info(InfoType.ressort, ressort)); * this.conflict = conflict; * }*/ public News(string headline, string author, string newspaper, string date, string location, bool isFake, string ressort, string error) { info = new Dictionary <InfoType, Info>(); info.Add(InfoType.headline, new Info(InfoType.headline, headline)); info.Add(InfoType.author, new Info(InfoType.author, author)); info.Add(InfoType.paper, new Info(InfoType.paper, newspaper)); info.Add(InfoType.date, new Info(InfoType.date, date)); info.Add(InfoType.place, new Info(InfoType.place, location)); info.Add(InfoType.ressort, new Info(InfoType.ressort, ressort)); if (isFake) { LogSystem.LogOnFile("Generating new news with error: " + error); conflict = new Inconsistency(error); } else { conflict = new Inconsistency(false); } }
// Token: 0x06000DD2 RID: 3538 RVA: 0x00053B3C File Offset: 0x00051D3C internal static CalendarRepairLogInconsistencyEntry CreateInstance(Inconsistency inconsistency) { return(new CalendarRepairLogInconsistencyEntry { inconsistency = inconsistency }); }
// Token: 0x06000DC5 RID: 3525 RVA: 0x000534E8 File Offset: 0x000516E8 private void AddInconsistency(Inconsistency inconsistency) { if (inconsistency.ShouldFix) { this.HasFixableInconsistency = true; } CalendarRepairLogInconsistencyEntry item = CalendarRepairLogInconsistencyEntry.CreateInstance(inconsistency); this.inconsistencyEntries.Add(item); }
public News(Info[] infos, Inconsistency conflict) { if (infos.Length != 6) { throw new System.Exception("infos must contain exactly 6 elements!"); } info = new Dictionary <InfoType, Info>(); foreach (Info info in infos) { this.info.Add(info.type, info); } this.conflict = conflict; }
public void NewMessage(Inconsistency handle) { MessengerWindow newMessenger = Instantiate(MessengerPrefab, GameManager.MainScreen.transform).GetComponent <MessengerWindow>(); string message = generator.GetMessage(handle); float moveHight = newMessenger.Show(message); foreach (MessengerWindow it in WindowList) { it.SlideUp(moveHight); } WindowList.Add(newMessenger); LogSystem.LogOnFile("New Message: " + message + " (based on inconsitency " + handle.info1.value + " <-> " + handle.info2.value + ")"); LogSystem.LogOnFile("Messages on Screen: " + WindowList.Count); }
public string GetMessage(Inconsistency inconsistency) { UnorderedTuple <InfoType> types = inconsistency.GetTypes(); string raw = GetRawMessage(types); try { if (argumentOrder[types].item1 == inconsistency.info1.type) { raw = raw.Replace("{0}", inconsistency.info1.value); raw = raw.Replace("{1}", inconsistency.info2.value); } else { raw = raw.Replace("{0}", inconsistency.info2.value); raw = raw.Replace("{1}", inconsistency.info1.value); } } catch { return(String.Format("No order found for InfoTypes {0} and {1}", types.item1, types.item2)); } return(raw); }