public async Task LoadStuff() { UI.InitialiseOptionLoaderDict(); AvailablePerks = AvailablePerks ?? FileReading.LoadJSON <AvailablePerks>("Data/Perks/Perks.txt"); LoadLottery(); LoadActivity(); CheckEvents(); await AMI.Neitsillia.Areas.Nests.Nest.LoadNests(); AMI.Handlers.TaskHandler.Initiate(); AMI.Neitsillia.NPCSystems.PopulationHandler.Start(); }
internal static Campaign Load(string name) { if (File.Exists(name)) { return(FileReading.LoadJSON <Campaign>(name)); } foreach (FileInfo file in new DirectoryInfo( cmpgPath).GetFiles()) { if (file.Name == name) { return(FileReading.LoadJSON <Campaign>(file.FullName)); } } return(null); }
//Lottery void LoadLottery() { if (lottery != null) { return; } if (File.Exists(Lottery.savePath)) { lottery = FileReading.LoadJSON <Lottery>(Lottery.savePath); } else { lottery = new Lottery(1, 1.00); } Task lotteryDueTime = new Task(async() => await LotteryThread()); lotteryDueTime.Start(); }
public static GuildSettings LoadJSONGuild(string guildID) { return(FileReading.LoadJSON <GuildSettings>(savePath + guildID)); }