protected virtual void ReadPlayerUnits(PrimitiveReader reader) { uint unitSections = reader.ReadUInt32(); PlayerData4[] duplicateData = new PlayerData4[8]; // TODO: Check this number. for (int i = 0; i < duplicateData.Length; i++) { duplicateData[i] = ReadPlayerData4(reader); } //System.Diagnostics.Debugger.Break(); Version version1 = Version1; Version version2 = Version2; Unit[][] units = new Unit[(int)unitSections][]; for (int i = 0; i < units.Length; i++) { uint unitCount = reader.ReadUInt32(); Unit[] playerUnits = new Unit[(int)unitCount]; for (int j = 0; j < playerUnits.Length; j++) { playerUnits[j] = Unit.ReadFrom(reader, version1, version2); } units[i] = playerUnits; } //System.Diagnostics.Debugger.Break(); }
static void ReadUnits(PrimitiveReader reader) { uint unitSections = reader.ReadUInt32(); Console.WriteLine("UNit POS" + reader.Stream.Position); //System.Diagnostics.Debugger.Break(); PlayerData4[] duplicateData = new PlayerData4[8]; // TODO: Check this number. for (int i = 0; i < duplicateData.Length; i++) { duplicateData[i] = ReadPlayerData4(reader); } System.Diagnostics.Debugger.Break(); Console.WriteLine("UNITS DATS POS" + reader.Stream.Position); //System.Diagnostics.Debugger.Break(); Unit[][] units = new Unit[(int)unitSections][]; for (int i = 0; i < units.Length; i++) { uint unitCount = reader.ReadUInt32(); //System.Diagnostics.Debugger.Break(); Console.WriteLine("COUT:" + unitCount); Unit[] playerUnits = new Unit[(int)unitCount]; for (int j = 0; j < playerUnits.Length; j++) { playerUnits[j] = Unit.ReadFrom(reader, vv1, vv2); } units[i] = playerUnits; } }
protected virtual PlayerData4 ReadPlayerData4(PrimitiveReader reader) { PlayerData4 value = new PlayerData4(); value.PopulationLimit = 75f; value.FoodCount = reader.ReadFloat32(); value.WoodCount = reader.ReadFloat32(); value.GoldCount = reader.ReadFloat32(); value.StoneCount = reader.ReadFloat32(); value.OreXCount = reader.ReadFloat32(); value.OreYCount = reader.ReadFloat32(); return(value); }
static PlayerData4 ReadPlayerData4(PrimitiveReader reader) { PlayerData4 value = new PlayerData4(); value.FoodCount = reader.ReadFloat32(); value.WoodCount = reader.ReadFloat32(); value.GoldCount = reader.ReadFloat32(); value.StoneCount = reader.ReadFloat32(); if (minorVersion2 >= 17) { value.OreXCount = reader.ReadFloat32(); value.OreYCount = reader.ReadFloat32(); } if (minorVersion >= 21) { value.PopulationLimit = reader.ReadFloat32(); } return(value); }