public FixedWeapon(IMyCubeBlock block) : base(block) { //Registrar.Add(CubeBlock, this); //Log.DebugLog("Initialized", "FixedWeapon()"); AllowFighterControl = WeaponDescription.GetFor(block).AllowFighterControl; }
private static WeaponDescription CreateFrom(MyCubeBlockDefinition definition) { if (string.IsNullOrWhiteSpace(definition.DescriptionString)) return new WeaponDescription(); WeaponDescription desc = new WeaponDescription(); try { XML_Amendments<WeaponDescription> ammender = new XML_Amendments<WeaponDescription>(desc); ammender.AmendAll(definition.DescriptionString, true); return ammender.Deserialize(); } catch (Exception ex) { Logger.debugNotify("Failed to load description for a weapon", 10000, Logger.severity.ERROR); Logger log = new Logger("WeaponDescription", () => definition.Id.ToString()); log.alwaysLog("Failed to load description for a weapon", Logger.severity.ERROR); log.alwaysLog("Exception: " + ex, Logger.severity.ERROR); return new WeaponDescription(); } }
private static WeaponDescription CreateFrom(MyCubeBlockDefinition definition) { if (string.IsNullOrWhiteSpace(definition.DescriptionString)) { return(new WeaponDescription()); } WeaponDescription desc = new WeaponDescription(); try { XML_Amendments <WeaponDescription> ammender = new XML_Amendments <WeaponDescription>(desc); ammender.AmendAll(definition.DescriptionString, true); return(ammender.Deserialize()); } catch (Exception ex) { Logger.DebugNotify("Failed to load description for a weapon", 10000, Logger.severity.ERROR); Logable Log = new Logable(definition.Id.ToString()); Log.AlwaysLog("Failed to load description for a weapon", Logger.severity.ERROR); Log.AlwaysLog("Exception: " + ex, Logger.severity.ERROR); return(new WeaponDescription()); } }