Пример #1
0
 public void Load( BinaryFormatter formatter )
 {
     OwnerType = formatter.ReadInt32();
     Owner = formatter.ReadInt32();
     X = formatter.ReadInt32();
     Y = formatter.ReadInt32();
 }
Пример #2
0
 public void Load( BinaryFormatter formatter )
 {
     Description = formatter.ReadString((int)BIQEspionageSizes.Description);
     DiplomatSpyMissionName = formatter.ReadString((int)BIQEspionageSizes.DiplomatSpyMissionName);
     CivilopediaEntry = formatter.ReadString((int)BIQEspionageSizes.CivilopediaEntry);
     MissionPerformedBy = formatter.ReadInt32();
     BaseCost = formatter.ReadInt32();
 }
Пример #3
0
        public void GetBufferFrames()
        {
            FileBuffer.Seek(0, SeekOrigin.Begin);
            BinaryFormatter mFormatter = new BinaryFormatter(FileBuffer);
            FlcHeader.ReadData(mFormatter);
            Civ3Header.ReadData(mFormatter);

            SFliFrameHeader frameHeader = new SFliFrameHeader();
            SFliChunkHeader chunkHeader = new SFliChunkHeader();

            mBufferFrames = new byte[FlcHeader.frames + 8][];
            mColourMap = new RGB[FlcHeader.frames + 8][];

            for (short frame = 0; frame < FlcHeader.frames + 8; frame++) {

                mBufferFrames[frame] = new byte[FlcHeader.width * FlcHeader.height];
                mColourMap[frame] = new RGB[256];

                if (frame > 0) {
                    Array.Copy(mBufferFrames[frame - 1], mBufferFrames[frame], sizeof(byte) * (FlcHeader.width * FlcHeader.height));
                    Array.Copy(mColourMap[frame - 1], mColourMap[frame], 256);
                }

                frameHeader.ReadData(mFormatter);

                if (frameHeader.magic != 0xf1fa) {
                    //fseek(fp, frameHeader.Size - sizeof(frameHeader), SEEK_CUR);

                    ulong size = (ulong)System.Runtime.InteropServices.Marshal.SizeOf(typeof(SFliFrameHeader));
                    mFormatter.ReadBytes((int)(frameHeader.size - size));

                    FlcHeader.frames--;
                    frame--;
                    continue;
                }

                for (int chunk = 0; chunk < frameHeader.chunks; chunk++) {
                    chunkHeader.ReadData(mFormatter);

                    switch (chunkHeader.type) {
                        case 4:
                            FlcColour256(mFormatter, frame);
                            break;
                        case 7:
                            long read = FlcDeltaFlc(mFormatter, frame);
                            mFormatter.ReadBytes((int)((long)chunkHeader.size - read));
                            break;
                        case 15:
                            FlcBitwiseRun(mFormatter, frame);
                            break;
                        default:
                            throw new NotImplementedException();

                    }
                }

            }
        }
Пример #4
0
 public void Load( BinaryFormatter formatter )
 {
     CultureOpinionName = formatter.ReadString( ( int ) BIQCultureSizes.CultureName );
     ChanceOfSuccessfulPropaganda = formatter.ReadInt32();
     CultureRatioPercentage = formatter.ReadInt32();
     CultureRatioDenominator = formatter.ReadInt32();
     CultureRatioNumerator = formatter.ReadInt32();
     InitialResistanceChance = formatter.ReadInt32();
     ContinuedResistanceChance = formatter.ReadInt32();
 }
Пример #5
0
        public void BufferFile(string path)
        {
            this.Path = path;
            this.fileName = System.IO.Path.GetFileNameWithoutExtension(this.Path);
            long length = new System.IO.FileInfo(Path).Length;
            FileBuffer = new MemoryStream(File.ReadAllBytes(Path));

            BinaryFormatter mFormatter = new BinaryFormatter(FileBuffer);
            FlcHeader.ReadData(mFormatter);
            Civ3Header.ReadData(mFormatter);
        }
Пример #6
0
        public void Load( BinaryFormatter formatter )
        {
            WorkerName = formatter.ReadString( ( int ) BIQWorkerJobSizes.WorkerName );
            CivilopediaEntry = formatter.ReadString( ( int ) BIQWorkerJobSizes.CivilopediaEntry );

            Turns = formatter.ReadInt32();
            Required = formatter.ReadInt32();
            RequireResource1 = formatter.ReadInt32();
            RequireResource2 = formatter.ReadInt32();
            Order = formatter.ReadString( ( int ) BIQWorkerJobSizes.Order );
        }
Пример #7
0
        public void Load( BinaryFormatter formatter )
        {
            Unknown1 = formatter.ReadInt32();
            Name = formatter.ReadString( ( int ) BIQFlavourSizes.Name );

            RelationWithOtherFlavor = new List<int>();

            NumberOfFlavors = formatter.ReadInt32();
            for ( int i = 0; i < NumberOfFlavors; i++ )
                RelationWithOtherFlavor.Add( formatter.ReadInt32() );
        }
Пример #8
0
        public void Load( BinaryFormatter formatter )
        {
            OptimalNumberOfCities = formatter.ReadInt32();
            TechRate = formatter.ReadInt32();
            Empty = formatter.ReadString( ( int ) BIQWorldSizeSizes.Empty );
            Name = formatter.ReadString( ( int ) BIQWorldSizeSizes.Name );

            Height = formatter.ReadInt32();
            DistanceBetweenCivs = formatter.ReadInt32();
            NumberOfCivs = formatter.ReadInt32();
            Width = formatter.ReadInt32();
        }
Пример #9
0
 public void Load( BinaryFormatter formatter )
 {
     Name = formatter.ReadString ( (int) BIQGameUnitSizes.Name );
     OwnerType = formatter.ReadInt32();
     ExperienceLevel = formatter.ReadInt32();
     Owner = formatter.ReadInt32();
     PRTONumber = formatter.ReadInt32();
     AIStrategy = formatter.ReadInt32();
     X = formatter.ReadInt32();
     Y = formatter.ReadInt32();
     PTWCustomName = formatter.ReadString( ( int ) BIQGameUnitSizes.PTWCustomName );
     UseCivilizationKing = formatter.ReadInt32();
 }
Пример #10
0
        public void Load( BinaryFormatter formatter )
        {
            //Name = formatter.ReadString( ( int ) BIQGameColonySizes.Name );
            OwnerType = formatter.ReadInt32();
            //ExperienceLevel = formatter.ReadInt32();
            Owner = formatter.ReadInt32();
            //PRTONumber = formatter.ReadInt32();
            //AIStrategy = formatter.ReadInt32();
            X = formatter.ReadInt32();
            Y = formatter.ReadInt32();
            //PTWCustomName = formatter.ReadString( ( int ) BIQGameColonySizes.PTWCustomName );
            //UseCivilizationKing = formatter.ReadInt32();

            ImprovementType = formatter.ReadInt32();
        }
Пример #11
0
        public void Load( BinaryFormatter formatter )
        {
            NumTotalResources = formatter.ReadInt32();

            int bytesOfAllowedResourceDataToInput = ( NumTotalResources + 7 ) / 8;
            PossibleResources = new List<byte>();
            for ( int j = 0; j < bytesOfAllowedResourceDataToInput; j++ )
                PossibleResources.Add ( formatter.ReadByte() );

            Name = formatter.ReadString( ( int ) BIQTerrainSizes.Name );
            Civlopedia = formatter.ReadString( ( int ) BIQTerrainSizes.CivilopediaEntry );

            FoodBonus = formatter.ReadInt32();

            ShieldsBonus = formatter.ReadInt32();
            CommerceBonus = formatter.ReadInt32();
            DefenceBonus = formatter.ReadInt32();
            MovementCost = formatter.ReadInt32();
            Food = formatter.ReadInt32();
            Shields = formatter.ReadInt32();
            Commerce = formatter.ReadInt32();
            WorkerJob = formatter.ReadInt32();
            PollutionEffect = formatter.ReadInt32();
            AllowCities = formatter.ReadByte();
            AllowColonies = formatter.ReadByte();
            Impassible = formatter.ReadByte();
            ImpassibleWheeled = formatter.ReadByte();
            AllowAirfields = formatter.ReadByte();
            AllowForts = formatter.ReadByte();
            AllowOutposts = formatter.ReadByte();
            AllowRadarTowers = formatter.ReadByte();

            Unknown1 = formatter.ReadInt32();
            LandmarkEnabled = formatter.ReadByte();
            LandmarkFood = formatter.ReadInt32();
            LandmarkShields = formatter.ReadInt32();
            LandmarkCommerce = formatter.ReadInt32();
            LandmarkFoodBonus = formatter.ReadInt32();
            LandmarkShieldBonus = formatter.ReadInt32();
            LandmarkCommerceBonus = formatter.ReadInt32();
            LandmarkMovementCost = formatter.ReadInt32();
            LandmarkDefenseBonus = formatter.ReadInt32();
            LandmarkName = formatter.ReadString( ( int ) BIQTerrainSizes.LandmarkName );
            LandmarkCivlopedia = formatter.ReadString( ( int ) BIQTerrainSizes.LandmarkCivlopedia);
            Unknown2 = formatter.ReadInt32();
            TerrainFlags = formatter.ReadInt32();
            DiseaseStrength = formatter.ReadInt32();
        }
Пример #12
0
 public void Load( BinaryFormatter formatter )
 {
     SelectedClimate = formatter.ReadInt32();
     ActualClimate = formatter.ReadInt32();
     SelectedBarbarianActivity = formatter.ReadInt32();
     ActualBarbarianActivity = formatter.ReadInt32();
     SelectedLandform = formatter.ReadInt32();
     ActualLandform = formatter.ReadInt32();
     SelectedOceanCoverage = formatter.ReadInt32();
     ActualOceanCoverage = formatter.ReadInt32();
     SelectedTemperature = formatter.ReadInt32();
     ActualTemperature = formatter.ReadInt32();
     SelectedAge = formatter.ReadInt32();
     ActualAge = formatter.ReadInt32();
     WorldSize = formatter.ReadInt32();
 }
Пример #13
0
        void FlcBitwiseRun(BinaryFormatter formatter, int frame)
        {
            int line = 0;
            int k, pos = 0;
            sbyte size;
            byte colour;

            while (line++ < FlcHeader.height) {
                formatter.ReadByte();
                k = 0;
                while (k < FlcHeader.width) {
                    size = (sbyte)formatter.ReadByte();

                    if (size > 0) {
                        colour = formatter.ReadByte();

                        k += size;
                        for (int j = 0; j < size; j++ )
                            mBufferFrames[frame][pos++] = colour;
                    }
                    else {
                        size = (sbyte)-size;
                        k += size;

                        for (int j = 0; j < size; j++) {
                            colour = formatter.ReadByte();
                            mBufferFrames[frame][pos++] = colour;
                        }

                    }
                }
            }
        }
Пример #14
0
        void FlcColour256(BinaryFormatter formatter, int frame)
        {
            short packets, idx;
            byte skip, change;

            packets = formatter.ReadShort16();

            idx = 0;
            for (int i = 0; i < packets; i++) {

                skip = formatter.ReadByte();
                idx += skip;

                change = formatter.ReadByte();

                if (change == 0) {

                    for (idx = 0; idx < 256; idx++) {
                        mColourMap[frame][idx].red = formatter.ReadByte();
                        mColourMap[frame][idx].green = formatter.ReadByte();
                        mColourMap[frame][idx].blue = formatter.ReadByte();
                    }

                }
                else {
                    for (int j = 0; j < change; j++) {
                        mColourMap[frame][idx].red = formatter.ReadByte();
                        mColourMap[frame][idx].green = formatter.ReadByte();
                        mColourMap[frame][idx].blue = formatter.ReadByte();
                        idx++;

                    }
                }

            }
        }
Пример #15
0
        long FlcDeltaFlc(BinaryFormatter formatter, int frame)
        {
            long pos, read;
            short lines, l, b, colour;
            byte skip;
            sbyte change;

            lines = formatter.ReadShort16();

            read = 6 + sizeof(short);

            l = 0;
            while (lines > 0) {
                pos = l * FlcHeader.width;

                b = formatter.ReadShort16();
                read += 2;
                if ((b & 0xC000) == 0x0000) {
                    b &= 0x3FFF;
                    for (int j = 0; j < b; j++) {
                        skip = formatter.ReadByte();
                        pos += skip;
                        read += 1;

                        change = formatter.ReadSByte();
                        read += 1;
                        if (change > 0) {
                            for (int i = 0; i < change; i++) {
                                colour = formatter.ReadShort16();
                                read += 2;
                                mBufferFrames[frame][pos++] = (byte)(colour & 0x00FF);
                                mBufferFrames[frame][pos++] = (byte)((colour >> 8) & 0x00FF);
                            }
                        }
                        else {
                            change = (sbyte)-change;
                            colour = formatter.ReadShort16();
                            read += 2;

                            for (int i = 0; i < change; i++) {
                                mBufferFrames[frame][pos++] = (byte)(colour & 0x00FF);
                                mBufferFrames[frame][pos++] = (byte)((colour >> 8) & 0x00FF);
                            }
                        }
                    }
                    lines--;
                    l++;

                }
                else {
                    if ((b & 0xC000) == 0xC000)
                        l -= b;
                    else
                        mBufferFrames[frame][pos++] = (byte)(b & 0x00FF);

                }
            }

            if ((read % 4) == 1) {
                formatter.ReadBytes(2);
                read++;
            }

            return read;
        }
Пример #16
0
 public void ReadData(BinaryFormatter mFormatter)
 {
     this.size = mFormatter.ReadUInt32();
     this.flags = mFormatter.ReadInt32();
     this.numAnims = mFormatter.ReadUShort16();
     this.animLength = mFormatter.ReadUShort16();
     this.xOffset = mFormatter.ReadUShort16();
     this.yOffset = mFormatter.ReadUShort16();
     this.xs_orig = mFormatter.ReadUShort16();
     this.ys_orig = mFormatter.ReadUShort16();
     this.animTime = mFormatter.ReadInt32();
     this.unknown12 = mFormatter.ReadInt32();
     this.stuff = mFormatter.ReadChars(12);
 }
Пример #17
0
            public short width; /* FLIC width in pixels */

            #endregion Fields

            #region Methods

            //BYTE												reserved3[40]; /* Set to zero */
            public void ReadData(BinaryFormatter mFormatter)
            {
                this.size = mFormatter.ReadInt32();
                this.type = mFormatter.ReadShort16();
                this.frames = mFormatter.ReadShort16();
                this.width = mFormatter.ReadShort16();
                this.height = mFormatter.ReadShort16();
                this.depth = mFormatter.ReadShort16();
                this.flags = mFormatter.ReadShort16();
                this.speed = mFormatter.ReadInt32();
                this.reserved1 = mFormatter.ReadShort16();
                this.created = mFormatter.ReadInt32();
                this.creator = mFormatter.ReadInt32();
                this.updated = mFormatter.ReadInt32();
                this.updater = mFormatter.ReadInt32();
                this.aspect_dx = mFormatter.ReadShort16();
                this.aspect_dy = mFormatter.ReadShort16();
                this.reserved2 = mFormatter.ReadChars(38);
                this.oframe1 = mFormatter.ReadInt32();
                this.oframe2 = mFormatter.ReadInt32();
            }
Пример #18
0
 public void ReadData(BinaryFormatter mFormatter)
 {
     this.size = mFormatter.ReadUInt32();
     this.magic = mFormatter.ReadUShort16();
     this.chunks = mFormatter.ReadUShort16();
     this.expand = mFormatter.ReadChars(8);
 }
Пример #19
0
 public void Load( BinaryFormatter formatter )
 {
     ExperienceLevelName = formatter.ReadString( ( int ) BIQExperienceSizes.ExperienceLevelName );
     BaseHitPoints = formatter.ReadInt32();
     RetreatBonus = formatter.ReadInt32();
 }
Пример #20
0
        public static void Load( BinaryFormatter formatter )
        {
            CitySizeLevelName1 = formatter.ReadString((int)BIQGeneralSizes.CitySizeLevelName1);
            CitySizeLevelName2 = formatter.ReadString((int)BIQGeneralSizes.CitySizeLevelName2);
            CitySizeLevelName3 = formatter.ReadString((int)BIQGeneralSizes.CitySizeLevelName3);

            NumSpaceShipParts = formatter.ReadInt32();

            NumNeeded = new List<int>();

            for ( int o = 0; o < NumSpaceShipParts; o++ )
                NumNeeded.Add( formatter.ReadInt32() );

            AdvancedBarbarian = formatter.ReadInt32();
            BasicBarbarian = formatter.ReadInt32();
            BarbarianSeaUnit = formatter.ReadInt32();
            NeededToSupportCity = formatter.ReadInt32();
            ChanceOfRioting = formatter.ReadInt32();
            DraftPenalty = formatter.ReadInt32();
            ShieldGoldCost = formatter.ReadInt32();
            FortressDefBonus = formatter.ReadInt32();
            CitizenHappyFace = formatter.ReadInt32();

            Unknown1 = formatter.ReadInt32();
            Unknown2 = formatter.ReadInt32();
            ForestShieldValue = formatter.ReadInt32();
            ShieldGoldValue = formatter.ReadInt32();
            CitizenShieldValue = formatter.ReadInt32();
            DefaultDiffLevel = formatter.ReadInt32();
            BattleCreatedUnit = formatter.ReadInt32();
            BuildArmyUnit = formatter.ReadInt32();
            BuildDefBonus = formatter.ReadInt32();
            CitizenDefBonus = formatter.ReadInt32();
            DefMoneyResource = formatter.ReadInt32();
            InterceptEnemyAir = formatter.ReadInt32();
            InterceptEnemyStealth = formatter.ReadInt32();

            StartingGold = formatter.ReadInt32();
            Unknown3 = formatter.ReadInt32();
            FoodPerCitizen = formatter.ReadInt32();
            RiverDefBonus = formatter.ReadInt32();
            TurnHurryPenalty = formatter.ReadInt32();
            Scout = formatter.ReadInt32();
            Slave = formatter.ReadInt32();
            RoadMovementRate = formatter.ReadInt32();
            StartUnit1 = formatter.ReadInt32();
            StartUnit2 = formatter.ReadInt32();
            WeLoveKingMinPop = formatter.ReadInt32();
            TownDefBonus = formatter.ReadInt32();
            CityDefBonus = formatter.ReadInt32();
            MetropolisDefBonus = formatter.ReadInt32();
            MinLevel1CitySize = formatter.ReadInt32();
            MinLevel2CitySize = formatter.ReadInt32();
            Unknown4 = formatter.ReadInt32();
            FortDefBonus = formatter.ReadInt32();

            NumCultureLevels = formatter.ReadInt32();

            CultureNames = new List<string>();
            for ( int i = 0; i < NumCultureLevels; i++ )
                CultureNames.Add ( formatter.ReadString(64));

            BorderExpansionMultiplier = formatter.ReadInt32();
            BorderFactor = formatter.ReadInt32();

            FutureTechCost = formatter.ReadInt32();
            GoldenAgeDuration = formatter.ReadInt32();
            MaxResearchTime = formatter.ReadInt32();
            MinResearchTime = formatter.ReadInt32();
            FlagUnit = formatter.ReadInt32();
            UpgradeCost = formatter.ReadInt32();
        }
Пример #21
0
        public void Load( BinaryFormatter formatter )
        {
            DefaultType = formatter.ReadInt32();
            TransitionType = formatter.ReadInt32();
            RequiresMaintenance = formatter.ReadInt32();
            Unknown = formatter.ReadInt32();
            StandardTilePenalty = formatter.ReadInt32();
            StandardTradeBonus = formatter.ReadInt32();

            GovernmentName = formatter.ReadString((int)BIQGovernmentSizes.GovernmentName);
            CivilopediaEntry = formatter.ReadString((int)BIQGovernmentSizes.CivilopediaEntry);
            MaleRulerTitle1 = formatter.ReadString((int)BIQGovernmentSizes.MaleRulerTitle1);
            FemaleRulerTitle1 = formatter.ReadString((int)BIQGovernmentSizes.FemaleRulerTitle1);
            MaleRulerTitle2 = formatter.ReadString((int)BIQGovernmentSizes.MaleRulerTitle2);
            FemaleRulerTitle2 = formatter.ReadString((int)BIQGovernmentSizes.FemaleRulerTitle2);
            MaleRulerTitle3 = formatter.ReadString((int)BIQGovernmentSizes.MaleRulerTitle3);
            FemaleRulerTitle3 = formatter.ReadString((int)BIQGovernmentSizes.FemaleRulerTitle3);
            MaleRulerTitle4 = formatter.ReadString((int)BIQGovernmentSizes.MaleRulerTitle4);
            FemaleRulerTitle4 = formatter.ReadString((int)BIQGovernmentSizes.FemaleRulerTitle4);

            CorruptionAndWaste = formatter.ReadInt32();
            ImmuneTo = formatter.ReadInt32();
            DiplomatsAre = formatter.ReadInt32();
            SpiesAre = formatter.ReadInt32();
            NumberOfGovernments = formatter.ReadInt32();

            GovernmentsPerformance = new List<BIQGovernment.SGovernmentPerformance>();
            for ( int o = 0; o < NumberOfGovernments; o++ )
            {
                SGovernmentPerformance governmentsPerformance = new SGovernmentPerformance();

                governmentsPerformance.CanBribeThisGovernmentType = formatter.ReadInt32();
                governmentsPerformance.BriberyModifierVs = formatter.ReadInt32();
                governmentsPerformance.ResistanceModifierVs = formatter.ReadInt32();

                GovernmentsPerformance.Add( governmentsPerformance );
            }

            Hurrying = formatter.ReadInt32();
            AssimilationChance = formatter.ReadInt32();
            DraftLimit = formatter.ReadInt32();
            MilitaryPoliceLimit = formatter.ReadInt32();
            RulerTitlePairsUsed = formatter.ReadInt32();// (max is 4);
            PrerequisiteTechnologyIndex = formatter.ReadInt32();// #;
            ScienceRateCap = formatter.ReadInt32();// (10 = 100% of gold can go to science);
            WorkerRate = formatter.ReadInt32();
            Unknown1 = formatter.ReadInt32(); //??? (-1 for Despotism/Communism, 0 for Anarchy/Monarchy,  1 for Republic/Democracy)
            Unknown2 = formatter.ReadInt32(); //		???; // (1 for Republic/Democracy, 0 for the rest)
            Unknown3 = formatter.ReadInt32(); //???;
            FreeUnits = formatter.ReadInt32(); //  (-1 = all, >=0 number of free units)
            FreeUnitsPerTown = formatter.ReadInt32();
            FreeUnitsPerCity = formatter.ReadInt32();
            FreeUnitsPerMetropolis = formatter.ReadInt32();
            CostUnit = formatter.ReadInt32();
            WarWeariness = formatter.ReadInt32();
            Xenophobic = formatter.ReadInt32();
            ForceResettle = formatter.ReadInt32();
        }
Пример #22
0
        public void Load( BinaryFormatter formatter )
        {
            ZoneOfControl = formatter.ReadInt32();
            Name = formatter.ReadString( ( int ) BIQUnitSizes.Name );
            Civlopedia = formatter.ReadString( ( int ) BIQUnitSizes.Civlopedia );
            BombardStrength = formatter.ReadInt32();
            BombardRange = formatter.ReadInt32();
            Capacity = formatter.ReadInt32();
            Cost = formatter.ReadInt32();
            Defence = formatter.ReadInt32();
            IconIndex = formatter.ReadInt32();
            Attack = formatter.ReadInt32();
            OperationalRange = formatter.ReadInt32();
            PopulationCost = formatter.ReadInt32();
            RateOfFire = formatter.ReadInt32();
            Movement = formatter.ReadInt32();
            Tech = formatter.ReadInt32();
            UpgradeTo = formatter.ReadInt32();
            Resource1 = formatter.ReadInt32();
            Resource2 = formatter.ReadInt32();
            Resource3 = formatter.ReadInt32();
            UnitAbilities = formatter.ReadInt32();
            AIStrategy = formatter.ReadInt32();
            AvailableTo = formatter.ReadInt32();
            StandardOrdersSpecialActions = formatter.ReadInt32();
            AirMissions = formatter.ReadInt32();
            UnitClass = formatter.ReadInt32();
            OtherStrategy = formatter.ReadInt32();
            HitPointBonus = formatter.ReadInt32();
            PTWStandardOrders = formatter.ReadInt32();
            PTWSpecialActions = formatter.ReadInt32();
            PTWWorkerActions = formatter.ReadInt32();
            PTWAirMissions = formatter.ReadInt32();

            PTWActionsMix = formatter.ReadShort16();
            Unknown1 = formatter.ReadShort16();
            BombardEffects = formatter.ReadInt32();
            IgnoreMovementCost = new List<byte>();
            for ( int i = 0; i < 14; i++ )
                IgnoreMovementCost.Add ( formatter.ReadByte() );
            RequireSupport = formatter.ReadInt32();
            UseExactCost = formatter.ReadInt32();
            TelepadRange = formatter.ReadInt32();
            Unknown4 = formatter.ReadInt32();
            NumLegalUnitTelepads = formatter.ReadInt32();

            LegalUnitTelepads = new List<int>();
            for ( int i = 0; i < NumLegalUnitTelepads; i++ )
                LegalUnitTelepads.Add( formatter.ReadInt32() );

            EnslaveResults = formatter.ReadInt32();
            Unknown6 = formatter.ReadInt32();
            NumberOfStealthTargets = formatter.ReadInt32();

            StealthTargets = new List<int>();
            for ( int i = 0; i < NumberOfStealthTargets; i++ )
                StealthTargets.Add ( formatter.ReadInt32() );

            Unknown7 = formatter.ReadInt32();
            NumLegalBuildingTelepads = formatter.ReadInt32();
            LegalBuildingTelepads = new List<int>();
            for ( int i = 0; i < NumLegalBuildingTelepads; i++ )
                LegalBuildingTelepads.Add( formatter.ReadInt32() );

            CreateCraters = formatter.ReadByte();
            WorkerStrength1 = formatter.ReadInt32();

            int temp = formatter.ReadInt32();
            if ( temp == 1 )
            {
                WorkerStrength2 = temp;
                WorkerStrength3 = formatter.ReadInt32();

                temp = formatter.ReadInt32();
            }

            Unknown9 = temp;
            AitDefense = formatter.ReadInt32();
        }
Пример #23
0
 public void ReadData(BinaryFormatter mFormatter)
 {
     this.size = mFormatter.ReadUInt32();
     this.type = mFormatter.ReadUShort16();
 }
Пример #24
0
 public void Load( BinaryFormatter formatter )
 {
     EraName = formatter.ReadString((int)BIQEraSizes.EraName);
     CivilopediaEntry = formatter.ReadString((int)BIQEraSizes.CivilopediaEntry);
     Researcher1 = formatter.ReadString((int)BIQEraSizes.Researcher1);
     Researcher2 = formatter.ReadString((int)BIQEraSizes.Researcher2);
     Researcher3 = formatter.ReadString((int)BIQEraSizes.Researcher3);
     Researcher4 = formatter.ReadString((int)BIQEraSizes.Researcher4);
     Researcher5 = formatter.ReadString((int)BIQEraSizes.Researcher5);
     NumberOfUsedResearcherNames = formatter.ReadInt32();
     Unknown = formatter.ReadInt32();
 }
Пример #25
0
        public void Load( BinaryFormatter formatter )
        {
            UseDefaultRules = formatter.ReadInt32();
            DefaultVictoryConditions = formatter.ReadInt32();
            NumberOfPlayableCivs = formatter.ReadInt32();

            IdOfPlayableCivs = new List<int>();
            for ( int i = 0; i < NumberOfPlayableCivs; i++ )
                IdOfPlayableCivs.Add( formatter.ReadInt32() );

            VictoryConditionsAndRules = formatter.ReadInt32();
            PlaceCaptureUnits = formatter.ReadInt32();
            AutoPlaceKings = formatter.ReadInt32();
            AutoPlaceVictoryLocations = formatter.ReadInt32();
            DebugMode = formatter.ReadInt32();
            UseTimeLimit = formatter.ReadInt32();
            BaseTimeUnit = formatter.ReadInt32();
            StartMonth = formatter.ReadInt32();
            StartWeek = formatter.ReadInt32();
            StartYear = formatter.ReadInt32();
            MinuteTimeLimit = formatter.ReadInt32();
            TurnTimeLimit = formatter.ReadInt32();

            TurnsPerTimescalePart = new List<int>();
            for ( int i = 0; i < 7; i++ )
                TurnsPerTimescalePart.Add( formatter.ReadInt32() );

            TimeUnitsPerTurn = new List<int>();
            for ( int i = 0; i < 7; i++ )
                TimeUnitsPerTurn.Add( formatter.ReadInt32() );

            ScenarioSearchFolders = formatter.ReadString( ( int ) BIQGameSizes.ScenarioSearchFolders );

            CivPartOfWhichAlliance = new List<int>();
            for ( int i = 0; i < NumberOfPlayableCivs; i++ )
                CivPartOfWhichAlliance.Add( formatter.ReadInt32() );

            VictoryPointLimit = formatter.ReadInt32();
            CityEliminationCount  = formatter.ReadInt32();
            OneCityCultureWinLimit  = formatter.ReadInt32();
            AllCitiesCultureWinLimit = formatter.ReadInt32();
            DominationTerrainPercent = formatter.ReadInt32();
            DominationPopulationPercent = formatter.ReadInt32();
            WonderVP = formatter.ReadInt32();
            DefeatingOpposingUnitVP = formatter.ReadInt32();
            AdvancementVP = formatter.ReadInt32();
            CityConquestVP = formatter.ReadInt32();
            VictoryPointVP = formatter.ReadInt32();
            CaptureSpecialUnitVP = formatter.ReadInt32();
            Unknown1 = formatter.ReadInt32();
            Unknown2 = formatter.ReadByte();

            Alliance0 = formatter.ReadString( ( int ) BIQGameSizes.Alliance0 );
            Alliance1 = formatter.ReadString( ( int ) BIQGameSizes.Alliance1 );
            Alliance2 = formatter.ReadString( ( int ) BIQGameSizes.Alliance2 );
            Alliance3 = formatter.ReadString( ( int ) BIQGameSizes.Alliance3 );
            Alliance4 = formatter.ReadString( ( int ) BIQGameSizes.Alliance4 );

            warWith0 = new List<int>();
            warWith1 = new List<int>();
            warWith2 = new List<int>();
            warWith3 = new List<int>();
            warWith4 = new List<int>();
            for ( int i = 0; i < 5; i++ )
            {
                warWith0.Add( formatter.ReadInt32() );
                warWith1.Add( formatter.ReadInt32() );
                warWith2.Add( formatter.ReadInt32() );
                warWith3.Add( formatter.ReadInt32() );
                warWith4.Add( formatter.ReadInt32() );
            }

            AllianceVictoryType = formatter.ReadInt32();

            PlaugeName = formatter.ReadString( ( int ) BIQGameSizes.PlaugeName );
            PermitPlagues = formatter.ReadByte();
            PlagueEarliestStart = formatter.ReadInt32();
            PlagueVariation = formatter.ReadInt32();
            PlagueDuration = formatter.ReadInt32();
            PlagueStrength = formatter.ReadInt32();
            PlagueGracePeriod = formatter.ReadInt32();
            PlagueMaxOccurance = formatter.ReadInt32();
            Unknown3 = formatter.ReadInt32();
            Unknown4 = formatter.ReadString( ( int ) BIQGameSizes.Unknown4 );
            RespawnFlagUnits = formatter.ReadInt32();
            CaptureAnyFlag = formatter.ReadByte();
            GoldForCapture = formatter.ReadInt32();
            MapVisible = formatter.ReadByte();
            RetainCulture = formatter.ReadByte();
            Unknown5 = formatter.ReadInt32();
            EruptionPeriod = formatter.ReadInt32();

            if ( BIQHeader.MajorVer == 12 && BIQHeader.MinorVer >= 7 )
            {
                MpBaseTime = formatter.ReadInt32();
                MpCityTime = formatter.ReadInt32();
                MpUnitTime = formatter.ReadInt32();
            }
            else
            {
                MpBaseTime = 24;
                MpCityTime = 2;
                MpUnitTime = 3;
            }
        }
Пример #26
0
 public void Load( BinaryFormatter formatter )
 {
     Name = formatter.ReadString( ( int ) BIQResourceSizes.Name );
     CivilopediaEntry = formatter.ReadString( ( int ) BIQResourceSizes.Civlopedia );
     Type = formatter.ReadInt32();
     AppearanceRatio = formatter.ReadInt32();
     DisappearanceProbability = formatter.ReadInt32();
     Icon = formatter.ReadInt32();
     Prerequisite = formatter.ReadInt32();
     FoodBonus = formatter.ReadInt32();
     ShieldsBonus = formatter.ReadInt32();
     CommerceBonus = formatter.ReadInt32();
 }
Пример #27
0
 public void Load( BinaryFormatter formatter )
 {
     Class = formatter.ReadInt32();
     NumTiles = formatter.ReadInt32();
 }
Пример #28
0
        public void Load( BinaryFormatter formatter )
        {
            Description = formatter.ReadString( ( int ) BIQBuildingSizes.Description );
            Name = formatter.ReadString( ( int ) BIQBuildingSizes.Name );
            Civlopedia = formatter.ReadString( ( int ) BIQBuildingSizes.Civlopedia );

            DoublesHappinessOf = formatter.ReadInt32();
            GainInEveryCity = formatter.ReadInt32();
            GainInEveryCityOnContinent = formatter.ReadInt32();
            RequiredBuilding = formatter.ReadInt32();
            Cost = formatter.ReadInt32();
            Culture = formatter.ReadInt32();
            BombardmentDefense = formatter.ReadInt32();
            NavalBombardmentDefense = formatter.ReadInt32();
            DefenseBonus = formatter.ReadInt32();
            NavalDefenseBonus = formatter.ReadInt32();
            MaintenanceCost = formatter.ReadInt32();
            HappyFacesAllCities = formatter.ReadInt32();
            HappyFaces = formatter.ReadInt32();
            UnhappyFacesAllCities = formatter.ReadInt32();
            UnhappyFaces = formatter.ReadInt32();
            NumberOfRequiredBuildings = formatter.ReadInt32();
            AirPower = formatter.ReadInt32();
            NavalPower = formatter.ReadInt32();
            Pollution = formatter.ReadInt32();
            Production = formatter.ReadInt32();
            RequiredGovernment = formatter.ReadInt32();
            SpaceshipPart = formatter.ReadInt32();
            RequiredAdvance = formatter.ReadInt32();
            RenderedObsoleteBy = formatter.ReadInt32();
            RequiredResource1 = formatter.ReadInt32();
            RequiredResource2 = formatter.ReadInt32();
            Improvements = formatter.ReadInt32();
            OtherCharacteristics = formatter.ReadInt32();
            SmallWonders = formatter.ReadInt32();
            Wonders = formatter.ReadInt32();
            NumberOfArmiesRequired = formatter.ReadInt32();
            Flavors = formatter.ReadInt32(); // Binary
            Unknown = formatter.ReadInt32();
            UnitProduced = formatter.ReadInt32(); // (PRTO ref)
            UnitFrequency = formatter.ReadInt32();
        }
Пример #29
0
        public void Load( BinaryFormatter formatter )
        {
            CustomCivData = formatter.ReadInt32();
            HumanPlayer = formatter.ReadInt32();
            LeaderName = formatter.ReadString((int)BIQLeadSizes.LeaderName);
            Unknown1 = formatter.ReadInt32();
            Unknown2 = formatter.ReadInt32();

            NumberOfDifferentStartUnits = formatter.ReadInt32();
            DifferentStartUnits = new List<StartUnits>();
            for (int i = 0; i < NumberOfDifferentStartUnits; i++)
            {
                StartUnits startUnits = new StartUnits();
                startUnits.UnitsOfThisType = formatter.ReadInt32();
                startUnits.TypeOfStartingUnit = formatter.ReadInt32();

                DifferentStartUnits.Add(startUnits);
            }

            GenderOfLeaderName = formatter.ReadInt32();

            NumberOfStartingTechnologies = formatter.ReadInt32();
            StartingTechnologies = new List<int>();
            for (int i = 0; i < NumberOfStartingTechnologies; i++)
                StartingTechnologies.Add(formatter.ReadInt32());

            Difficulty = formatter.ReadInt32();
            InitialEra = formatter.ReadInt32();
            StartCash = formatter.ReadInt32();
            Government = formatter.ReadInt32();
            Civ = formatter.ReadInt32();
            Color = formatter.ReadInt32();
            SkipFirstTurn = formatter.ReadInt32();

            Unknown3 = formatter.ReadInt32();
            StartEmbassies = formatter.ReadByte();
        }
Пример #30
0
        public void Load( BinaryFormatter formatter )
        {
            RiverConnectionInfo = formatter.ReadByte();
            Border = formatter.ReadByte();
            Resource = formatter.ReadInt32();
            Image = formatter.ReadByte();
            File = formatter.ReadByte();
            Unknown1 = formatter.ReadShort16();
            Overlays = formatter.ReadByte();
            BaseRealTerrain = formatter.ReadByte();
            Bonuses = formatter.ReadByte();
            RiverCrossingData = formatter.ReadByte();
            BarbarianTribe = formatter.ReadShort16();
            City = formatter.ReadShort16();
            Colony = formatter.ReadShort16();
            Continent = formatter.ReadShort16();
            Unknown2 = formatter.ReadByte();
            VictoryPointLocation = formatter.ReadShort16();
            Ruin = formatter.ReadInt32();

            // Conquests
            C3COverlays = formatter.ReadInt32();
            Unknown3 = formatter.ReadByte();
            C3CBaseRealTerrain = formatter.ReadByte();
            Unknown4 = formatter.ReadShort16();
            FogOfWar = formatter.ReadShort16();
            C3CBonuses = formatter.ReadInt32();
            Unknown5 = formatter.ReadShort16();
        }