static Outpost() { StabilityBonusThresholds = Db.Query().CommandText("select * from intrusionsitestabilitythreshold").Execute().Select(r => new StabilityBonusThreshold(r)).ToArray(); _sapInfos = Db.Query().CommandText("select * from intrusionsaps").Execute().ToLookup(r => r.GetValue <long>("siteEid"), r => { var x = r.GetValue <int>("x"); var y = r.GetValue <int>("y"); return(new SAPInfo(EntityDefault.Get(r.GetValue <int>("definition")), new Position(x, y).Center)); }); var bonusList = StabilityBonusThresholds.Where(bi => bi.bonusType == StabilityBonusType.DefenseNodes).ToArray(); DefenseNodesStabilityLimit = bonusList.Length > 0 ? bonusList[0].threshold : 5000; }
public static int GetDockingRightsStabilityLimit() { var bonusList = StabilityBonusThresholds.Where(bi => bi.bonusType == StabilityBonusType.DockingRights).ToArray(); if (bonusList.Length == 0) { Logger.Error("no docking rights level is defined. falling back to 5000."); return(5000); } if (bonusList.Length != 1) { Debug.Assert(false, "more than one DockingRights threshold is defined. "); } return(bonusList.First().threshold); }