public ObjectUpgradeConfig GetUpgradeConfig(string file, uint guid, int level)
        {
            RuntimeUpgradeFile upgradeFile = null;

            if (FileUpgrades.TryGetValue(file, out upgradeFile))
            {
                upgradeFile.Load(ContentManager);
                return(upgradeFile.GetConfig(guid));
            }
            return(null);
        }
        public RuntimeUpgradeFile GetRuntimeFile(string name)
        {
            RuntimeUpgradeFile upgradeFile = null;

            if (FileUpgrades.TryGetValue(name, out upgradeFile))
            {
                upgradeFile.Load(ContentManager);
                return(upgradeFile);
            }
            return(null);
        }
        public Dictionary <int, Dictionary <int, short> > GetUpgrade(string file, uint guid, int level)
        {
            // find upgrade table for this file, find entries for this object, and the specified level.
            RuntimeUpgradeFile upgradeFile = null;

            if (FileUpgrades.TryGetValue(file, out upgradeFile))
            {
                upgradeFile.Load(ContentManager);
                return(upgradeFile.GetUpgradeTuning(guid, level));
            }
            return(null);
        }
        public int?GetUpgradePrice(string file, uint guid, int level, int currentLevel = -1, int currentValue = 0)
        {
            // we need the whole upgrade list to calculate this, as it may include relative price upgrades.
            RuntimeUpgradeFile upgradeFile = null;

            if (FileUpgrades.TryGetValue(file, out upgradeFile))
            {
                upgradeFile.Load(ContentManager);
                return(upgradeFile.GetPrice(guid, level, currentLevel, currentValue));
            }
            return(null);
        }
        public void UpdateFile(UpgradeIff iff, bool forceLoad)
        {
            if (!ActiveFile.Files.Contains(iff))
            {
                ActiveFile.Files.Add(iff);
            }
            var runtime = new RuntimeUpgradeFile(iff);

            if (forceLoad)
            {
                runtime.Load(ContentManager);
            }
            FileUpgrades[iff.Name] = runtime;
        }