public Team(BinaryReader br) { short num1 = br.ReadInt16(); this.namedSubAssets = new Dictionary <string, SubAsset>((int)num1); uint num2 = 0U; for (int index = 0; index < (int)num1; ++index) { string name = SubAsset.PeekSubAssetName(br); if (name.StartsWith("teamUnitType")) { SubAsset <string> subAsset1 = new SubAsset <string>(br, name, this.namedSubAssets); } else if (name.StartsWith("teamUnitMaxCount")) { SubAsset <int> subAsset2 = new SubAsset <int>(br, name, this.namedSubAssets); } else if (name.StartsWith("teamUnitMinCount")) { SubAsset <int> subAsset3 = new SubAsset <int>(br, name, this.namedSubAssets); } else { switch (name) { case "teamName": this.teamName = new SubAsset <string>(br, name, this.namedSubAssets); continue; case "teamOwner": this.teamOwner = new SubAsset <string>(br, name, this.namedSubAssets); continue; case "teamIsSingleton": this.teamIsSingleton = new SubAsset <bool>(br, name, this.namedSubAssets); continue; case "exportWithScript": SubAsset <bool> subAsset4 = new SubAsset <bool>(br, name, this.namedSubAssets); continue; default: SubAsset.ReadAsBytes(br, name); ++num2; continue; } } } if (num2 <= 0U) { return; } Console.WriteLine("!\t Asset: {0} skipped parsing {1} SubAssets", (object)this, (object)num2); }
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 Player(BinaryReader br) { short num1 = br.ReadInt16(); this.namedSubAssets = new Dictionary <string, SubAsset>((int)num1); uint num2 = 0U; for (int index = 0; index < (int)num1; ++index) { string name = SubAsset.PeekSubAssetName(br); switch (name) { case "playerName": this.playerName = new SubAsset <string>(br, name, this.namedSubAssets); break; case "playerIsHuman": this.playerIsHuman = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "playerDisplayName": this.playerDisplayName = new SubAsset <string>(br, name, this.namedSubAssets); break; case "playerFaction": this.playerFaction = new SubAsset <string>(br, name, this.namedSubAssets); break; case "playerAllies": this.playerAllies = new SubAsset <string>(br, name, this.namedSubAssets); break; case "playerEnemies": this.playerEnemies = new SubAsset <string>(br, name, this.namedSubAssets); break; case "aiBaseBuilder": this.aiBaseBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiUnitBuilder": this.aiUnitBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiTeamBuilder": this.aiTeamBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiEconomyBuilder": this.aiEconomyBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiWallBuilder": this.aiWallBuilder = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiUnitUpgrader": this.aiUnitUpgrader = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiScienceUpgrader": this.aiScienceUpgrader = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiTactical": this.aiTactical = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiOpeningMover": this.aiOpeningMover = new SubAsset <Player.AIDifficulty>(br, name, this.namedSubAssets); break; case "aiPersonality": this.aiPersonality = new SubAsset <string>(br, name, this.namedSubAssets); break; case "playerColor": this.playerColor = new SubAsset <int>(br, name, this.namedSubAssets); break; case "playerRadarColor": this.playerRadarColor = new SubAsset <int>(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); } this.trailer = br.ReadInt32(); if (this.trailer == 0) { return; } Console.WriteLine("!\t Asset: Player expected int 0 for trailer"); }
public WorldInfo(BinaryReader br, string[] assetStrings) : base(br) { short num1 = br.ReadInt16(); uint num2 = 0U; for (int index = 0; index < (int)num1; ++index) { string name = SubAsset.PeekSubAssetName(br); switch (name) { case "musicZone": this.musicZone = new SubAsset <string>(br, name, this.namedSubAssets); break; case "terrainTextureStrings": this.terrainTextureStrings = new SubAsset <string>(br, name, this.namedSubAssets); break; case "weather": this.weather = new SubAsset <WorldInfo.WeatherType>(br, name, this.namedSubAssets); break; case "mapName": this.mapName = new SubAsset <string>(br, name, this.namedSubAssets); break; case "mapDescription": this.mapDescription = new SubAsset <string>(br, name, this.namedSubAssets); break; case "compression": this.compression = new SubAsset <WorldInfo.CompressionType>(br, name, this.namedSubAssets); break; case "cameraGroundMinHeight": this.cameraGroundMinHeight = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraGroundMaxHeight": this.cameraGroundMaxHeight = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraMinHeight": this.cameraMinHeight = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraMaxHeight": this.cameraMaxHeight = new SubAsset <float>(br, name, this.namedSubAssets); break; case "isScenarioMultiplayer": this.isScenarioMultiplayer = new SubAsset <bool>(br, name, this.namedSubAssets); break; case "cameraPitchAngle": this.cameraPitchAngle = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraYawAngle": this.cameraYawAngle = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraScrollSpeedScalar": this.cameraScrollSpeedScalar = new SubAsset <float>(br, name, this.namedSubAssets); break; case "cameraMapHeightSmoothnessScalar": this.cameraMapHeightSmoothnessScalar = new SubAsset <float>(br, name, this.namedSubAssets); break; case "isLivingWorldScriptHolder": SubAsset <bool> subAsset = new SubAsset <bool>(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); } this.CheckParsedSize(br); if (this.mapName != null) { return; } this.mapName = new SubAsset <string>("mapName", "", this.namedSubAssets); }