public static GameScreen Create(ScreenManager screenManager, SeedOptionsCollection options) { void Noop() { } return((GameScreen)Activator.CreateInstance(RelicMenuScreenType, GetSave(options), screenManager.Reflected.GCM, (Action)Noop)); }
static GameSave GetSave(SeedOptionsCollection options) { var save = GameSave.DemoSave; save.Inventory.AsDynamic()._relicInventory = options; return(save); }
internal void OnSeedOptionsUpdated(SeedOptionsCollection options) { var hexString = GetHexString(); var seedId = hexString.Substring(0, Seed.Length - SeedOptions.Length); if (Seed.TryParse(seedId + options, out var seed)) { SetSeed(seed.ToString()); } }
static void UpdateMenuItems(object menuRelicInventory) { var relicInventory = menuRelicInventory.AsDynamic(); var options = ((IEnumerable <InventoryItem>)relicInventory._items) .Cast <InventoryRelic>() .Select(r => r.Key) .ToArray(); var entries = (IList)relicInventory.Entries; var entryMapping = (IList <int>)relicInventory.KeyToItemLookup; foreach (var option in options) { var entry = entries[entryMapping.IndexOf(option)].AsDynamic(); var optionInfo = SeedOptionsCollection.GetSeedOptionInfo(option); entry.SetText(optionInfo.Name); entry.Description = optionInfo.Description; } }