public void SetTech(App app, int TechID) { this._techID = TechID; string techid = app.GameDatabase.GetTechFileID(this._techID); int techId = this._techID; app.GameDatabase.GetPlayerTechInfo(app.LocalPlayer.ID, techId); Kerberos.Sots.Data.TechnologyFramework.Tech tech = app.AssetDatabase.MasterTechTree.Technologies.First <Kerberos.Sots.Data.TechnologyFramework.Tech>((Func <Kerberos.Sots.Data.TechnologyFramework.Tech, bool>)(x => x.Id == techid)); string spriteName1 = ResearchInfoPanel.IconTextureToSpriteName(tech.Icon); string spriteName2 = ResearchInfoPanel.IconTextureToSpriteName(app.AssetDatabase.MasterTechTree.TechFamilies.First <TechFamily>((Func <TechFamily, bool>)(x => x.Id == tech.Family)).Icon); app.UI.SetPropertyString("tech_title", "text", App.Localize("@TECH_NAME_" + tech.Id)); app.UI.SetPropertyString("techicon", "sprite", spriteName1); app.UI.SetPropertyString("familyicon", "sprite", spriteName2); app.UI.SetText("tech_desc", App.Localize("@TECH_DESC_" + tech.Id)); LogicalWeapon weaponUnlockedByTech = this.GetWeaponUnlockedByTech(app, tech); if (weaponUnlockedByTech != null) { app.UI.SetVisible("TechWeaponDetails", true); this._weaponinfopanel.SetWeapons(weaponUnlockedByTech, (LogicalWeapon)null); } else { app.UI.SetVisible("TechWeaponDetails", false); } }
private bool IsRoot(Tech value) { return(!this.Technologies.Any <Tech>((Func <Tech, bool>)(x => x.Allows.Any <Allowable>((Func <Allowable, bool>)(y => y.Id == value.Id))))); }
private LogicalWeapon GetWeaponUnlockedByTech(App app, Kerberos.Sots.Data.TechnologyFramework.Tech tech) { return(app.AssetDatabase.Weapons.FirstOrDefault <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => ((IEnumerable <Kerberos.Sots.Data.WeaponFramework.Tech>)x.RequiredTechs).Any <Kerberos.Sots.Data.WeaponFramework.Tech>((Func <Kerberos.Sots.Data.WeaponFramework.Tech, bool>)(y => y.Name == tech.Id))))); }
public Kerberos.Sots.Data.TechnologyFramework.TechFamilies GetTechFamilyEnum( Tech tech) { return(this.GetTechFamilyEnumFromName(tech.Family)); }