public Object(BinaryReader br) : base(br) { this.position = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle()); this.angle = (float)((double)br.ReadSingle() * 180.0 / 3.14159274101257); this.roadOptions = (Object.RoadOptions)br.ReadInt32(); this.typeName = IOUtility.ReadString(br); short num1 = br.ReadInt16(); uint num2 = 0U; for (int index = 0; index < (int)num1; ++index) { string name = SubAsset.PeekSubAssetName(br); switch (name) { case "objectInitialHealth": this.objectInitialHealth = new SubAsset <int>(br, name, this.namedSubAssets); break; case "objectEnabled": this.objectEnabled = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectIndestructible": this.objectIndestructible = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectUnsellable": this.objectUnsellable = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectPowered": this.objectPowered = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectRecruitableAI": this.objectRecruitableAI = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectTargetable": this.objectTargetable = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectSleeping": this.objectSleeping = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectBasePriority": this.objectBasePriority = new SubAsset <int>(br, name, this.namedSubAssets); break; case "objectBasePhase": this.objectBasePhase = new SubAsset <int>(br, name, this.namedSubAssets); break; case "originalOwner": this.originalOwner = new SubAsset <string>(br, name, this.namedSubAssets); break; case "uniqueID": this.uniqueID = new SubAsset <string>(br, name, this.namedSubAssets); break; case "objectLayer": this.objectLayer = new SubAsset <string>(br, name, this.namedSubAssets); break; case "objectName": this.objectName = new SubAsset <string>(br, name, this.namedSubAssets); break; case "objectPrototypeScale": this.objectPrototypeScale = new SubAsset <float>(br, name, this.namedSubAssets); break; case "alignToTerrain": this.alignToTerrain = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectTime": this.objectTime = new SubAsset <int>(br, name, this.namedSubAssets); break; case "objectWeather": this.objectWeather = new SubAsset <int>(br, name, this.namedSubAssets); break; case "objectEventsList": this.objectEventsList = new SubAsset <string>(br, name, this.namedSubAssets); break; case "objectInitialStance": this.objectInitialStance = new SubAsset <int>(br, name, this.namedSubAssets); break; case "exportWithScript": this.exportWithScript = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbient": this.objectSoundAmbient = new SubAsset <string>(br, name, this.namedSubAssets); break; case "scorchType": this.scorchType = new SubAsset <int>(br, name, this.namedSubAssets); break; case "objectRadius": this.objectRadius = new SubAsset <float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientEnabled": SubAsset <bool> subAsset1 = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbientCustomized": SubAsset <bool> subAsset2 = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbientVolume": SubAsset <float> subAsset3 = new SubAsset <float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientMaxRange": SubAsset <float> subAsset4 = new SubAsset <float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientMinRange": SubAsset <float> subAsset5 = new SubAsset <float>(br, name, this.namedSubAssets); break; case "waypointID": this.waypointID = new SubAsset <int>(br, name, this.namedSubAssets); break; case "waypointName": this.waypointName = new SubAsset <string>(br, name, this.namedSubAssets); break; case "waypointTypeOption": this.waypointTypeOption = new SubAsset <string>(br, name, this.namedSubAssets); break; case "waypointPathLabel1": this.waypointPathLabel1 = new SubAsset <string>(br, name, this.namedSubAssets); break; case "waypointPathLabel2": this.waypointPathLabel2 = new SubAsset <string>(br, name, this.namedSubAssets); break; case "waypointPathLabel3": this.waypointPathLabel3 = new SubAsset <string>(br, name, this.namedSubAssets); break; case "waypointPathBiDirectional": this.waypointPathBiDirectional = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "waypointType": this.waypointType = new SubAsset <Object.WaypointType>(br, name, this.namedSubAssets); break; default: SubAsset.ReadAsBytes(br, name); ++num2; break; } } if (num2 > 0U) { Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this.GetType().Name, (object)num2); } if (this.roadOptions == (Object.RoadOptions) 0) { return; } Console.WriteLine("!\t Asset: Object - {0} roadOptions = {1}", (object)this.uniqueID.data, (object)this.roadOptions); }
public Object(BinaryReader br) : base(br) { this.position = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle()); this.angle = (float)((double)br.ReadSingle() * 180.0 / 3.14159274101257); this.roadOptions = (Object.RoadOptions)br.ReadInt32(); this.typeName = IOUtility.ReadString(br); short num1 = br.ReadInt16(); uint num2 = 0U; for (int index = 0; index < (int)num1; ++index) { string name = SubAsset.PeekSubAssetName(br); switch (name) { case "objectInitialHealth": this.objectInitialHealth = new SubAsset<int>(br, name, this.namedSubAssets); break; case "objectEnabled": this.objectEnabled = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectIndestructible": this.objectIndestructible = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectUnsellable": this.objectUnsellable = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectPowered": this.objectPowered = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectRecruitableAI": this.objectRecruitableAI = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectTargetable": this.objectTargetable = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectSleeping": this.objectSleeping = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectBasePriority": this.objectBasePriority = new SubAsset<int>(br, name, this.namedSubAssets); break; case "objectBasePhase": this.objectBasePhase = new SubAsset<int>(br, name, this.namedSubAssets); break; case "originalOwner": this.originalOwner = new SubAsset<string>(br, name, this.namedSubAssets); break; case "uniqueID": this.uniqueID = new SubAsset<string>(br, name, this.namedSubAssets); break; case "objectLayer": this.objectLayer = new SubAsset<string>(br, name, this.namedSubAssets); break; case "objectName": this.objectName = new SubAsset<string>(br, name, this.namedSubAssets); break; case "objectPrototypeScale": this.objectPrototypeScale = new SubAsset<float>(br, name, this.namedSubAssets); break; case "alignToTerrain": this.alignToTerrain = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectTime": this.objectTime = new SubAsset<int>(br, name, this.namedSubAssets); break; case "objectWeather": this.objectWeather = new SubAsset<int>(br, name, this.namedSubAssets); break; case "objectEventsList": this.objectEventsList = new SubAsset<string>(br, name, this.namedSubAssets); break; case "objectInitialStance": this.objectInitialStance = new SubAsset<int>(br, name, this.namedSubAssets); break; case "exportWithScript": this.exportWithScript = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbient": this.objectSoundAmbient = new SubAsset<string>(br, name, this.namedSubAssets); break; case "scorchType": this.scorchType = new SubAsset<int>(br, name, this.namedSubAssets); break; case "objectRadius": this.objectRadius = new SubAsset<float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientEnabled": SubAsset<bool> subAsset1 = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbientCustomized": SubAsset<bool> subAsset2 = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "objectSoundAmbientVolume": SubAsset<float> subAsset3 = new SubAsset<float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientMaxRange": SubAsset<float> subAsset4 = new SubAsset<float>(br, name, this.namedSubAssets); break; case "objectSoundAmbientMinRange": SubAsset<float> subAsset5 = new SubAsset<float>(br, name, this.namedSubAssets); break; case "waypointID": this.waypointID = new SubAsset<int>(br, name, this.namedSubAssets); break; case "waypointName": this.waypointName = new SubAsset<string>(br, name, this.namedSubAssets); break; case "waypointTypeOption": this.waypointTypeOption = new SubAsset<string>(br, name, this.namedSubAssets); break; case "waypointPathLabel1": this.waypointPathLabel1 = new SubAsset<string>(br, name, this.namedSubAssets); break; case "waypointPathLabel2": this.waypointPathLabel2 = new SubAsset<string>(br, name, this.namedSubAssets); break; case "waypointPathLabel3": this.waypointPathLabel3 = new SubAsset<string>(br, name, this.namedSubAssets); break; case "waypointPathBiDirectional": this.waypointPathBiDirectional = new SubAsset<bool>(br, name, this.namedSubAssets); break; case "waypointType": this.waypointType = new SubAsset<Object.WaypointType>(br, name, this.namedSubAssets); break; default: SubAsset.ReadAsBytes(br, name); ++num2; break; } } if (num2 > 0U) Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this.GetType().Name, (object)num2); if (this.roadOptions == (Object.RoadOptions)0) return; Console.WriteLine("!\t Asset: Object - {0} roadOptions = {1}", (object)this.uniqueID.data, (object)this.roadOptions); }