public static TaleNews GenerateTaleNewsGenerally(TaleNewsTypeEnum typeEnum) { TaleNews newsInstance = Activator.CreateInstance(typeEnum.GetTypeForEnum()) as TaleNews; DesynchronizedMain.TaleNewsDatabaseSystem.RegisterNewTaleNews(newsInstance); return(newsInstance); }
public static TaleNewsNegativeIndividual GenerateTaleNewsNegativeIndividual(TaleNewsTypeEnum typeEnum, Pawn primaryVictim, InstigationInfo instigatorInfo) { TaleNewsNegativeIndividual taleNews = GenerateTaleNewsGenerally(typeEnum) as TaleNewsNegativeIndividual; taleNews.primaryVictim = primaryVictim; taleNews.instigatorInfo = instigatorInfo; return(taleNews); }
public static Type GetTypeForEnum(this TaleNewsTypeEnum typeEnum) { switch (typeEnum) { case TaleNewsTypeEnum.PawnDied: return(typeof(TaleNewsPawnDied)); default: return(typeof(Object)); } }