public void FullyLoad() { Log.InfoFormat("fully loading database: version='{0}', nationName='{1}'", this.Version, this.RootPath); if (this.IsFullyLoaded) { Log.Info("this database is already fully loaded"); return; } //this.ReadVersion(); this.InitializePackages(); var scriptEntries = PackageStream.GetFileEntries(Path.Combine(RootPath, ScriptsPackageFile)); var nationEntries = scriptEntries.Where(s => s.StartsWith(VehiclesFolderInPackage) && s.Length > VehiclesFolderInPackage.Length).Select(s => s.Substring(VehiclesFolderInPackage.Length, s.IndexOf("/", VehiclesFolderInPackage.Length, StringComparison.InvariantCulture) - VehiclesFolderInPackage.Length)).Distinct(); foreach (var nationName in nationEntries) { if (Database.IsTechTreeFolder(nationName, scriptEntries)) { var nation = new NationalDatabase(this, nationName); Log.InfoFormat("adding nation database: {0}", nation.Key); this.Nations.Add(nation.Key, nation); } } this.LoadCommonData(); this.LoadBenchmarkTanks(); this.IsFullyLoaded = true; }
public HierachyInfo <TTankObject> ToHierachyInfo <TTankObject>(NationalDatabase nation) where TTankObject : TankObject { return(new HierachyInfo <TTankObject>((TTankObject)nation.GetTankObject(this.Target), this.ExperiencePrice)); }
public TankInfo(NationalDatabase nation) : base(nation.Database) { this.Nation = nation; }