public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _name = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "name", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("name", exists); } else { SetPropertyExistsInBaseData("name", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "name")); } SetPropertyExists("name", exists); _missileType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "missileType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileType", exists); } else { SetPropertyExistsInBaseData("missileType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileType")); } SetPropertyExists("missileType", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _ribbonID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "ribbonID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("ribbonID", exists); } else { SetPropertyExistsInBaseData("ribbonID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "ribbonID")); } SetPropertyExists("ribbonID", exists); _trailParticleName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "trailParticleName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("trailParticleName", exists); } else { SetPropertyExistsInBaseData("trailParticleName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "trailParticleName")); } SetPropertyExists("trailParticleName", exists); _explosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionID", exists); } else { SetPropertyExistsInBaseData("explosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionID")); } SetPropertyExists("explosionID", exists); _missileParticleName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "missileParticleName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileParticleName", exists); } else { SetPropertyExistsInBaseData("missileParticleName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileParticleName")); } SetPropertyExists("missileParticleName", exists); _cruiseSpeed = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "cruiseSpeed", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("cruiseSpeed", exists); } else { SetPropertyExistsInBaseData("cruiseSpeed", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "cruiseSpeed")); } SetPropertyExists("cruiseSpeed", exists); _timeTillCruise = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillCruise", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillCruise", exists); } else { SetPropertyExistsInBaseData("timeTillCruise", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillCruise")); } SetPropertyExists("timeTillCruise", exists); _initialVelocity = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialVelocity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialVelocity", exists); } else { SetPropertyExistsInBaseData("initialVelocity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialVelocity")); } SetPropertyExists("initialVelocity", exists); _initialLife = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialLife", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialLife", exists); } else { SetPropertyExistsInBaseData("initialLife", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialLife")); } SetPropertyExists("initialLife", exists); _timeTillActive = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillActive", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillActive", exists); } else { SetPropertyExistsInBaseData("timeTillActive", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillActive")); } SetPropertyExists("timeTillActive", exists); _damage = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _health = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "health", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("health", exists); } else { SetPropertyExistsInBaseData("health", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "health")); } SetPropertyExists("health", exists); _yaw = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "yaw", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("yaw", exists); } else { SetPropertyExistsInBaseData("yaw", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "yaw")); } SetPropertyExists("yaw", exists); _pitch = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "pitch", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("pitch", exists); } else { SetPropertyExistsInBaseData("pitch", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "pitch")); } SetPropertyExists("pitch", exists); _roll = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "roll", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("roll", exists); } else { SetPropertyExistsInBaseData("roll", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "roll")); } SetPropertyExists("roll", exists); _bAntiCapital = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bAntiCapital", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bAntiCapital", exists); } else { SetPropertyExistsInBaseData("bAntiCapital", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bAntiCapital")); } SetPropertyExists("bAntiCapital", exists); _bSelfTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bSelfTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bSelfTarget", exists); } else { SetPropertyExistsInBaseData("bSelfTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bSelfTarget")); } SetPropertyExists("bSelfTarget", exists); _bReAcquireTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bReAcquireTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bReAcquireTarget", exists); } else { SetPropertyExistsInBaseData("bReAcquireTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bReAcquireTarget")); } SetPropertyExists("bReAcquireTarget", exists); _missileSize = ParseHelpers.GetVector3DFromVD2Data(DataXMLDoc, "missileSize", out exists); _missileSize.OnElementChanged += missileSize_OnElementChanged; if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("missileSize", exists); } else { SetPropertyExistsInBaseData("missileSize", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "missileSize")); } SetPropertyExists("missileSize", exists); _mirv = DataStructureParseHelpers.GetmirvDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("mirv", exists); } else { SetPropertyExistsInBaseData("mirv", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "mirv")); } SetPropertyExists("mirv", exists); base.LoadDataFromXML(); } }
public override void LoadDataFromXML() { bool exists = false; if (DataXMLDoc != null) { _objectID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectID", exists); } else { SetPropertyExistsInBaseData("objectID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(objectID, "objectID")); } SetPropertyExists("objectID", exists); _objectType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "objectType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("objectType", exists); } else { SetPropertyExistsInBaseData("objectType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "objectType")); } SetPropertyExists("objectType", exists); _mineType = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "mineType", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("mineType", exists); } else { SetPropertyExistsInBaseData("mineType", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "mineType")); } SetPropertyExists("mineType", exists); _meshName = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "meshName", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("meshName", exists); } else { SetPropertyExistsInBaseData("meshName", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "meshName")); } SetPropertyExists("meshName", exists); _explosionID = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "explosionID", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("explosionID", exists); } else { SetPropertyExistsInBaseData("explosionID", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "explosionID")); } SetPropertyExists("explosionID", exists); _minimumShipClass = ParseHelpers.GetStringFromVD2Data(DataXMLDoc, "minimumShipClass", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("minimumShipClass", exists); } else { SetPropertyExistsInBaseData("minimumShipClass", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "minimumShipClass")); } SetPropertyExists("minimumShipClass", exists); _detectionProximity = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "detectionProximity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("detectionProximity", exists); } else { SetPropertyExistsInBaseData("detectionProximity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "detectionProximity")); } SetPropertyExists("detectionProximity", exists); _weaponPush = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "weaponPush", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("weaponPush", exists); } else { SetPropertyExistsInBaseData("weaponPush", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "weaponPush")); } SetPropertyExists("weaponPush", exists); _renderingDistance = ParseHelpers.GetInt32FromVD2Data(DataXMLDoc, "renderingDistance", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("renderingDistance", exists); } else { SetPropertyExistsInBaseData("renderingDistance", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "renderingDistance")); } SetPropertyExists("renderingDistance", exists); _cruiseSpeed = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "cruiseSpeed", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("cruiseSpeed", exists); } else { SetPropertyExistsInBaseData("cruiseSpeed", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "cruiseSpeed")); } SetPropertyExists("cruiseSpeed", exists); _timeTillCruise = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillCruise", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillCruise", exists); } else { SetPropertyExistsInBaseData("timeTillCruise", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillCruise")); } SetPropertyExists("timeTillCruise", exists); _initialVelocity = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialVelocity", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialVelocity", exists); } else { SetPropertyExistsInBaseData("initialVelocity", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialVelocity")); } SetPropertyExists("initialVelocity", exists); _initialLife = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "initialLife", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("initialLife", exists); } else { SetPropertyExistsInBaseData("initialLife", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "initialLife")); } SetPropertyExists("initialLife", exists); _timeTillActive = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "timeTillActive", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("timeTillActive", exists); } else { SetPropertyExistsInBaseData("timeTillActive", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "timeTillActive")); } SetPropertyExists("timeTillActive", exists); _damage = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "damage", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("damage", exists); } else { SetPropertyExistsInBaseData("damage", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "damage")); } SetPropertyExists("damage", exists); _health = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "health", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("health", exists); } else { SetPropertyExistsInBaseData("health", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "health")); } SetPropertyExists("health", exists); _yaw = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "yaw", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("yaw", exists); } else { SetPropertyExistsInBaseData("yaw", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "yaw")); } SetPropertyExists("yaw", exists); _pitch = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "pitch", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("pitch", exists); } else { SetPropertyExistsInBaseData("pitch", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "pitch")); } SetPropertyExists("pitch", exists); _roll = ParseHelpers.GetFloatFromVD2Data(DataXMLDoc, "roll", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("roll", exists); } else { SetPropertyExistsInBaseData("roll", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "roll")); } SetPropertyExists("roll", exists); _bUseParentTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bUseParentTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bUseParentTarget", exists); } else { SetPropertyExistsInBaseData("bUseParentTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bUseParentTarget")); } SetPropertyExists("bUseParentTarget", exists); _bSpinner = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bSpinner", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bSpinner", exists); } else { SetPropertyExistsInBaseData("bSpinner", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bSpinner")); } SetPropertyExists("bSpinner", exists); _bKeepTarget = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bKeepTarget", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bKeepTarget", exists); } else { SetPropertyExistsInBaseData("bKeepTarget", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bKeepTarget")); } SetPropertyExists("bKeepTarget", exists); _bCheckFriendOrFoe = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bCheckFriendOrFoe", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bCheckFriendOrFoe", exists); } else { SetPropertyExistsInBaseData("bCheckFriendOrFoe", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bCheckFriendOrFoe")); } SetPropertyExists("bCheckFriendOrFoe", exists); _bCanAddViaBattleEditorSlider = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bCanAddViaBattleEditorSlider", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bCanAddViaBattleEditorSlider", exists); } else { SetPropertyExistsInBaseData("bCanAddViaBattleEditorSlider", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bCanAddViaBattleEditorSlider")); } SetPropertyExists("bCanAddViaBattleEditorSlider", exists); _bIgnoresShields = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bIgnoresShields", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bIgnoresShields", exists); } else { SetPropertyExistsInBaseData("bIgnoresShields", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bIgnoresShields")); } SetPropertyExists("bIgnoresShields", exists); _bHeatMine = ParseHelpers.GetBoolFromVD2Data(DataXMLDoc, "bHeatMine", out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("bHeatMine", exists); } else { SetPropertyExistsInBaseData("bHeatMine", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "bHeatMine")); } SetPropertyExists("bHeatMine", exists); _mirv = DataStructureParseHelpers.GetmirvDataStructureFromVD2Data(this, DataXMLDoc, out exists); if (Source.ShortName == "Base") { SetPropertyExistsInBaseData("mirv", exists); } else { SetPropertyExistsInBaseData("mirv", EditorUI.UI.Ships.DoesPropertyExistInBaseData(GetObjectID(), "mirv")); } SetPropertyExists("mirv", exists); base.LoadDataFromXML(); } }