コード例 #1
0
        public static GameScreen Create(ScreenManager screenManager, SeedOptionsCollection options)
        {
            void Noop()
            {
            }

            return((GameScreen)Activator.CreateInstance(RelicMenuScreenType, GetSave(options), screenManager.Reflected.GCM, (Action)Noop));
        }
コード例 #2
0
        static GameSave GetSave(SeedOptionsCollection options)
        {
            var save = GameSave.DemoSave;

            save.Inventory.AsDynamic()._relicInventory = options;

            return(save);
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
        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;
            }
        }