Beispiel #1
0
            public UnitCommand ReadData(RAMBuffer buffer)
            {
                One        = buffer.ReadShort();
                ID         = buffer.ReadShort();
                Unknown1   = buffer.ReadByte();
                Type       = buffer.ReadShort();
                ClassID    = buffer.ReadShort();
                UnitID     = buffer.ReadShort();
                TerrainID  = buffer.ReadShort();
                ResourceIn = buffer.ReadShort();
                ResourceProductivityMultiplier = buffer.ReadShort();
                ResourceOut        = buffer.ReadShort();
                Resource           = buffer.ReadShort();
                WorkRateMultiplier = buffer.ReadFloat();
                ExecutionRadius    = buffer.ReadFloat();
                ExtraRange         = buffer.ReadFloat();
                Unknown4           = buffer.ReadByte();
                Unknown5           = buffer.ReadFloat();
                SelectionEnabler   = buffer.ReadByte();
                Unknown7           = buffer.ReadByte();
                PlunderSource      = buffer.ReadShort();
                Unknown9           = buffer.ReadShort();
                SelectionMode      = buffer.ReadByte();
                RightClickMode     = buffer.ReadByte();
                Unknown12          = buffer.ReadByte();

                Graphics = new List <short>(6);
                for (int i = 0; i < 6; ++i)
                {
                    Graphics.Add(buffer.ReadShort());
                }

                return(this);
            }
Beispiel #2
0
            public BuildingAnnex ReadData(RAMBuffer buffer)
            {
                UnitID        = buffer.ReadShort();
                MisplacementX = buffer.ReadFloat();
                MisplacementY = buffer.ReadFloat();

                return(this);
            }
Beispiel #3
0
            /// <summary>
            /// Reads the data element from the given buffer.
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized from.</param>
            public PlayerDiplomacyVariousEntry ReadData(RAMBuffer buffer)
            {
                PlayerName     = buffer.ReadString(buffer.ReadUShort());
                InitialCameraX = buffer.ReadFloat();
                InitialCameraY = buffer.ReadFloat();
                UnknownX       = buffer.ReadShort();
                UnknownY       = buffer.ReadShort();
                AlliedVictory  = buffer.ReadByte();

                ushort playerDiplomacyCount = buffer.ReadUShort();

                Diplomacy1 = new List <DiplomacyTypes1>(playerDiplomacyCount);
                for (int i = 0; i < playerDiplomacyCount; i++)
                {
                    Diplomacy1.Add((DiplomacyTypes1)buffer.ReadByte());
                }
                Diplomacy2 = new List <DiplomacyTypes2>(playerDiplomacyCount);
                for (int i = 0; i < playerDiplomacyCount; i++)
                {
                    Diplomacy2.Add((DiplomacyTypes2)buffer.ReadUInteger());
                }

                Color         = buffer.ReadUInteger();
                Unknown1      = buffer.ReadFloat();
                Unknown3Count = buffer.ReadUShort();

                if (Unknown1 == 2)
                {
                    Unknown2 = new List <byte>(8);
                    for (int i = 0; i < 8; i++)
                    {
                        Unknown2.Add(buffer.ReadByte());
                    }
                }

                Unknown3 = new List <byte>(Unknown3Count * 44);
                for (int i = 0; i < Unknown3Count * 44; i++)
                {
                    Unknown3.Add(buffer.ReadByte());
                }

                Unknown4 = new List <byte>(7);
                for (int i = 0; i < 7; i++)
                {
                    Unknown4.Add(buffer.ReadByte());
                }

                Unknown5 = buffer.ReadInteger();

                return(this);
            }
Beispiel #4
0
            /// <summary>
            /// Reads the data element from the given buffer.
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized from.</param>
            public UnitEntry ReadData(RAMBuffer buffer)
            {
                PositionX  = buffer.ReadFloat();
                PositionY  = buffer.ReadFloat();
                PositionZ  = buffer.ReadFloat();
                Id         = buffer.ReadUInteger();
                UnitId     = buffer.ReadUShort();
                State      = buffer.ReadByte();
                Rotation   = buffer.ReadFloat();
                Frame      = buffer.ReadUShort();
                GarrisonId = buffer.ReadInteger();

                return(this);
            }
Beispiel #5
0
        public Bird ReadData(RAMBuffer buffer)
        {
            SheepConversion = buffer.ReadShort();
            SearchRadius    = buffer.ReadFloat();
            WorkRate        = buffer.ReadFloat();
            DropSite1       = buffer.ReadShort();
            DropSite2       = buffer.ReadShort();
            VillagerMode    = buffer.ReadByte();
            AttackSound     = buffer.ReadShort();
            MoveSound       = buffer.ReadShort();
            AnimalMode      = buffer.ReadByte();

            return(this);
        }
Beispiel #6
0
        public Graphic ReadData(RAMBuffer buffer)
        {
            Name1 = buffer.ReadString(21);
            Name2 = buffer.ReadString(13);

            SLP         = buffer.ReadInteger();
            Unknown1    = buffer.ReadByte();
            Unknown2    = buffer.ReadByte();
            Layer       = buffer.ReadByte();
            PlayerColor = buffer.ReadByte();
            Rainbow     = buffer.ReadByte();
            Replay      = buffer.ReadByte();

            Coordinates = new List <short>(4);
            for (int i = 0; i < 4; ++i)
            {
                Coordinates.Add(buffer.ReadShort());
            }

            int deltaCount = buffer.ReadUShort();

            SoundID         = buffer.ReadShort();
            AttackSoundUsed = buffer.ReadByte();
            FrameCount      = buffer.ReadUShort();
            AngleCount      = buffer.ReadUShort();
            NewSpeed        = buffer.ReadFloat();
            FrameRate       = buffer.ReadFloat();
            ReplayDelay     = buffer.ReadFloat();
            SequenceType    = buffer.ReadByte();
            ID            = buffer.ReadShort();
            MirroringMode = buffer.ReadByte();
            Unknown3      = buffer.ReadByte();

            Deltas = new List <GraphicDelta>(deltaCount);
            for (int i = 0; i < deltaCount; ++i)
            {
                Deltas.Add(new GraphicDelta().ReadData(buffer));
            }

            if (AttackSoundUsed != 0)
            {
                AttackSounds = new List <GraphicAttackSound>(AngleCount);
                for (int i = 0; i < AngleCount; ++i)
                {
                    AttackSounds.Add(new GraphicAttackSound().ReadData(buffer));
                }
            }

            return(this);
        }
Beispiel #7
0
            public TerrainBorder ReadData(RAMBuffer buffer)
            {
                Enabled = buffer.ReadByte();
                Random  = buffer.ReadByte();

                Name  = buffer.ReadString(13);
                Name2 = buffer.ReadString(13);

                SLP      = buffer.ReadInteger();
                ShapePtr = buffer.ReadInteger();
                SoundID  = buffer.ReadInteger();

                Colors = new List <byte>(3);
                for (int i = 0; i < 3; ++i)
                {
                    Colors.Add(buffer.ReadByte());
                }

                IsAnimated        = buffer.ReadByte();
                AnimationFrames   = buffer.ReadShort();
                PauseFames        = buffer.ReadShort();
                Interval          = buffer.ReadFloat();
                PauseBetweenLoops = buffer.ReadFloat();
                Frame             = buffer.ReadShort();
                DrawFrame         = buffer.ReadShort();
                AnimateLast       = buffer.ReadFloat();
                FrameChanged      = buffer.ReadByte();
                Drawn             = buffer.ReadByte();

                Borders = new List <List <FrameData> >(19);
                for (int i = 0; i < 19; ++i)
                {
                    List <FrameData> frameData = new List <FrameData>(12);
                    for (int j = 0; j < 12; ++j)
                    {
                        frameData.Add(new FrameData().ReadData(buffer));
                    }
                    Borders.Add(frameData);
                }

                DrawTerrain     = buffer.ReadShort();
                UnderlayTerrain = buffer.ReadShort();
                BorderStyle     = buffer.ReadShort();

                return(this);
            }
Beispiel #8
0
        public DeadFish ReadData(RAMBuffer buffer)
        {
            WalkingGraphic1     = buffer.ReadShort();
            WalkingGraphic2     = buffer.ReadShort();
            RotationSpeed       = buffer.ReadFloat();
            Unknown11           = buffer.ReadByte();
            TrackingUnit        = buffer.ReadShort();
            TrackingUnitUsed    = buffer.ReadByte();
            TrackingUnitDensity = buffer.ReadFloat();
            Unknown16           = buffer.ReadByte();

            Unknown16B = new List <int>(5);
            for (int i = 0; i < 5; ++i)
            {
                Unknown16B.Add(buffer.ReadInteger());
            }

            return(this);
        }
Beispiel #9
0
            public TechageEffect ReadData(RAMBuffer buffer)
            {
                Type = buffer.ReadByte();
                A    = buffer.ReadShort();
                B    = buffer.ReadShort();
                C    = buffer.ReadShort();
                D    = buffer.ReadFloat();

                return(this);
            }
Beispiel #10
0
        public Projectile ReadData(RAMBuffer buffer)
        {
            StretchMode       = buffer.ReadByte();
            CompensationMode  = buffer.ReadByte();
            DropAnimationMode = buffer.ReadByte();
            PenetrationMode   = buffer.ReadByte();
            Unknown24         = buffer.ReadByte();
            ProjectileArc     = buffer.ReadFloat();

            return(this);
        }
Beispiel #11
0
        public Creatable ReadData(RAMBuffer buffer)
        {
            ResourceCosts = new List <ResourceTuple <short, short, short> >(3);
            for (int i = 0; i < 3; ++i)
            {
                ResourceCosts.Add(new ResourceTuple <short, short, short>()
                {
                    Type = buffer.ReadShort(), Amount = buffer.ReadShort(), Mode = buffer.ReadShort()
                });
            }

            TrainTime       = buffer.ReadShort();
            TrainLocationID = buffer.ReadShort();
            ButtonID        = buffer.ReadByte();
            Unknown26       = buffer.ReadFloat();
            Unknown27       = buffer.ReadFloat();
            Unknown28       = buffer.ReadByte();
            HeroMode        = buffer.ReadByte();
            GarrisonGraphic = buffer.ReadInteger();
            ProjectileCount = buffer.ReadFloat();
            ProjectileCountOnFullGarrison    = buffer.ReadByte();
            ProjectileSpawningAreaWidth      = buffer.ReadFloat();
            ProjectileSpawningAreaHeight     = buffer.ReadFloat();
            ProjectileSpawningAreaRandomness = buffer.ReadFloat();
            AlternativeProjectileUnit        = buffer.ReadInteger();
            ChargingGraphic      = buffer.ReadInteger();
            ChargingMode         = buffer.ReadByte();
            DisplayedPierceArmor = buffer.ReadShort();

            return(this);
        }
Beispiel #12
0
        /// <summary>
        /// Reads the data element from the given buffer.
        /// </summary>
        /// <param name="buffer">The buffer where the data element should be deserialized from.</param>
        public Header ReadData(RAMBuffer buffer)
        {
            NextUnitIdToPlace = buffer.ReadUInteger();

            float version = buffer.ReadFloat();

            if (version != 1.22f)
            {
                throw new InvalidDataException($"Invalid secondary file version: '{version}'");
            }

            PlayerNames = new List <string>(16);
            for (int i = 0; i < 16; ++i)
            {
                PlayerNames.Add(buffer.ReadString(256));
            }

            PlayerNameDllIds = new List <uint>(16);
            for (int i = 0; i < 16; ++i)
            {
                PlayerNameDllIds.Add(buffer.ReadUInteger());
            }

            PlayerData = new List <PlayerDataHeader>(16);
            for (int i = 0; i < 16; ++i)
            {
                PlayerData.Add(new PlayerDataHeader().ReadData(buffer));
            }

            Unknown1 = buffer.ReadUInteger();
            byte unknown = buffer.ReadByte();             // = 0

            Unknown2 = buffer.ReadFloat();

            short length = buffer.ReadShort();

            OriginalFileName = buffer.ReadString(length);

            return(this);
        }
Beispiel #13
0
        public Building ReadData(RAMBuffer buffer)
        {
            ConstructionGraphicID = buffer.ReadShort();
            SnowGraphicID         = buffer.ReadShort();
            AdjacentMode          = buffer.ReadByte();
            GraphicsAngle         = buffer.ReadShort();
            DisappearsWhenBuilt   = buffer.ReadByte();
            StackUnitID           = buffer.ReadShort();
            FoundationTerrainID   = buffer.ReadShort();
            OldTerrainLikeID      = buffer.ReadShort();
            ResearchID            = buffer.ReadShort();
            Unknown33             = buffer.ReadByte();

            Annexes = new List <BuildingAnnex>(4);
            for (int i = 0; i < 4; ++i)
            {
                Annexes.Add(new BuildingAnnex().ReadData(buffer));
            }

            HeadUnit               = buffer.ReadShort();
            TransformUnit          = buffer.ReadShort();
            UnknownSound           = buffer.ReadShort();
            ConstructionSound      = buffer.ReadShort();
            GarrisonType           = buffer.ReadByte();
            GarrisonHealRateFactor = buffer.ReadFloat();
            Unknown35              = buffer.ReadFloat();
            PileUnit               = buffer.ReadShort();

            LootingTable = new List <byte>(6);
            for (int i = 0; i < 6; ++i)
            {
                LootingTable.Add(buffer.ReadByte());
            }

            return(this);
        }
Beispiel #14
0
        public Type50 ReadData(RAMBuffer buffer)
        {
            DefaultArmor = buffer.ReadShort();

            ushort attackCount = buffer.ReadUShort();

            Attacks = new Dictionary <ushort, ushort>(attackCount);
            for (int i = 0; i < attackCount; ++i)
            {
                Attacks[buffer.ReadUShort()] = buffer.ReadUShort();
            }

            ushort armourCount = buffer.ReadUShort();

            Armors = new Dictionary <ushort, ushort>(armourCount);
            for (int i = 0; i < armourCount; ++i)
            {
                Armors[buffer.ReadUShort()] = buffer.ReadUShort();
            }

            TerrainRestrictionForDamageMultiplying = buffer.ReadShort();
            MaxRange                  = buffer.ReadFloat();
            BlastRadius               = buffer.ReadFloat();
            ReloadTime                = buffer.ReadFloat();
            ProjectileUnitID          = buffer.ReadShort();
            ProjectileAccuracyPercent = buffer.ReadShort();
            TowerMode                 = buffer.ReadByte();
            ProjectileFrameDelay      = buffer.ReadShort();

            ProjectileGraphicDisplacement = new List <float>(3);
            for (int i = 0; i < 3; ++i)
            {
                ProjectileGraphicDisplacement.Add(buffer.ReadFloat());
            }

            BlastLevel           = buffer.ReadByte();
            MinRange             = buffer.ReadFloat();
            ProjectileDispersion = buffer.ReadFloat();
            AttackGraphic        = buffer.ReadShort();
            DisplayedMeleeArmor  = buffer.ReadShort();
            DisplayedAttack      = buffer.ReadShort();
            DisplayedRange       = buffer.ReadFloat();
            DisplayedReloadTime  = buffer.ReadFloat();

            return(this);
        }
        public TerrainRestriction ReadData(RAMBuffer buffer)
        {
            TerrainAccessibleFlags = new List <float>(TerrainCount);
            for (int i = 0; i < TerrainCount; ++i)
            {
                TerrainAccessibleFlags.Add(buffer.ReadFloat());
            }

            TerrainPassGraphics = new List <TerrainPassGraphic>(TerrainCount);
            for (int i = 0; i < TerrainCount; ++i)
            {
                TerrainPassGraphics.Add(new TerrainPassGraphic().ReadData(buffer));
            }

            return(this);
        }
Beispiel #16
0
            /// <summary>
            /// Reads the data element from the given buffer.
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized from.</param>
            public ResourcePopulationEntry ReadData(RAMBuffer buffer)
            {
                Gold            = buffer.ReadFloat();
                Wood            = buffer.ReadFloat();
                Food            = buffer.ReadFloat();
                Stone           = buffer.ReadFloat();
                Ore             = buffer.ReadFloat();
                Padding         = buffer.ReadUInteger();
                PopulationLimit = buffer.ReadFloat();

                return(this);
            }
Beispiel #17
0
        public Civ ReadData(RAMBuffer buffer)
        {
            One  = buffer.ReadByte();
            Name = buffer.ReadString(20);
            int resourceCount = buffer.ReadUShort();

            TechTreeID  = buffer.ReadShort();
            TeamBonusID = buffer.ReadShort();

            Resources = new List <float>(resourceCount);
            for (int i = 0; i < resourceCount; ++i)
            {
                Resources.Add(buffer.ReadFloat());
            }

            IconSet = buffer.ReadByte();

            int unitCount = buffer.ReadUShort();

            UnitPointers = new List <int>(unitCount);
            for (int i = 0; i < unitCount; ++i)
            {
                UnitPointers.Add(buffer.ReadInteger());
            }

            Units = new SortedList <int, Unit>(unitCount);
            for (int p = 0; p < UnitPointers.Count; ++p)
            {
                if (UnitPointers[p] != 0)
                {
                    Units.Add(p, new Unit().ReadData(buffer));
                }
            }

            return(this);
        }
Beispiel #18
0
            public Unit ReadData(RAMBuffer buffer)
            {
                Type                    = (UnitType)buffer.ReadByte();
                NameLength1             = buffer.ReadUShort();
                ID1                     = buffer.ReadShort();
                LanguageDLLName         = buffer.ReadUShort();
                LanguageDLLCreation     = buffer.ReadUShort();
                Class                   = buffer.ReadShort();
                StandingGraphic1        = buffer.ReadShort();
                StandingGraphic2        = buffer.ReadShort();
                DyingGraphic1           = buffer.ReadShort();
                DyingGraphic2           = buffer.ReadShort();
                DeathMode               = buffer.ReadByte();
                HitPoints               = buffer.ReadShort();
                LineOfSight             = buffer.ReadFloat();
                GarrisonCapacity        = buffer.ReadByte();
                SizeRadius1             = buffer.ReadFloat();
                SizeRadius2             = buffer.ReadFloat();
                HPBarHeight1            = buffer.ReadFloat();
                TrainSound1             = buffer.ReadShort();
                TrainSound2             = buffer.ReadShort();
                DeadUnitID              = buffer.ReadShort();
                PlacementMode           = buffer.ReadByte();
                AirMode                 = buffer.ReadByte();
                IconID                  = buffer.ReadShort();
                HideInEditor            = buffer.ReadByte();
                Unknown1                = buffer.ReadShort();
                Enabled                 = buffer.ReadByte();
                Disabled                = buffer.ReadByte();
                PlacementBypassTerrain1 = buffer.ReadShort();
                PlacementBypassTerrain2 = buffer.ReadShort();
                PlacementTerrain1       = buffer.ReadShort();
                PlacementTerrain2       = buffer.ReadShort();
                EditorRadius1           = buffer.ReadFloat();
                EditorRadius2           = buffer.ReadFloat();
                HillMode                = buffer.ReadByte();
                VisibleInFog            = buffer.ReadByte();
                TerrainRestriction      = buffer.ReadShort();
                FlyMode                 = buffer.ReadByte();
                ResourceCapacity        = buffer.ReadShort();
                ResourceDecay           = buffer.ReadFloat();
                BlastType               = buffer.ReadByte();
                Unknown2                = buffer.ReadByte();
                InteractionMode         = buffer.ReadByte();
                MinimapMode             = buffer.ReadByte();
                CommandAttribute        = buffer.ReadByte();
                Unknown3A               = buffer.ReadFloat();
                MinimapColor            = buffer.ReadByte();
                LanguageDLLHelp         = buffer.ReadInteger();
                LanguageDLLHotKeyText   = buffer.ReadInteger();
                HotKey                  = buffer.ReadInteger();
                Unselectable            = buffer.ReadByte();
                Unknown6                = buffer.ReadByte();
                UnknownSelectionMode    = buffer.ReadByte();
                Unknown8                = buffer.ReadByte();
                SelectionMask           = buffer.ReadByte();
                SelectionShapeType      = buffer.ReadByte();
                SelectionShape          = buffer.ReadByte();
                Attribute               = buffer.ReadByte();
                Civilization            = buffer.ReadByte();
                Nothing                 = buffer.ReadShort();
                SelectionEffect         = buffer.ReadByte();
                EditorSelectionColor    = buffer.ReadByte();
                SelectionRadius1        = buffer.ReadFloat();
                SelectionRadius2        = buffer.ReadFloat();
                HPBarHeight2            = buffer.ReadFloat();

                ResourceStorages = new List <ResourceTuple <short, float, byte> >(3);
                for (int i = 0; i < 3; ++i)
                {
                    ResourceStorages.Add(new ResourceTuple <short, float, byte>()
                    {
                        Type = buffer.ReadShort(), Amount = buffer.ReadFloat(), Mode = buffer.ReadByte()
                    });
                }

                int damageGraphicCount = buffer.ReadByte();

                DamageGraphics = new List <DamageGraphic>();
                for (int i = 0; i < damageGraphicCount; ++i)
                {
                    DamageGraphics.Add(new DamageGraphic().ReadData(buffer));
                }

                SelectionSound = buffer.ReadShort();
                DyingSound     = buffer.ReadShort();
                AttackMode     = buffer.ReadByte();
                EdibleMeat     = buffer.ReadByte();
                Name1          = buffer.ReadString(NameLength1);
                ID2            = buffer.ReadShort();
                ID3            = buffer.ReadShort();

                if (Type >= UnitType.Flag)
                {
                    Speed = buffer.ReadFloat();
                }
                if (Type >= UnitType.DeadFish)
                {
                    DeadFish = new UnitTypes.DeadFish().ReadData(buffer);
                }
                if (Type >= UnitType.Bird)
                {
                    Bird = new UnitTypes.Bird().ReadData(buffer);
                }
                if (Type >= UnitType.Type50)
                {
                    Type50 = new UnitTypes.Type50().ReadData(buffer);
                }
                if (Type == UnitType.Projectile)
                {
                    Projectile = new UnitTypes.Projectile().ReadData(buffer);
                }
                if (Type >= UnitType.Creatable)
                {
                    Creatable = new UnitTypes.Creatable().ReadData(buffer);
                }
                if (Type == UnitType.Building)
                {
                    Building = new UnitTypes.Building().ReadData(buffer);
                }

                return(this);
            }
Beispiel #19
0
            public Terrain ReadData(RAMBuffer buffer)
            {
                Enabled = buffer.ReadByte();
                Random  = buffer.ReadByte();

                Name  = buffer.ReadString(13);
                Name2 = buffer.ReadString(13);

                SLP      = buffer.ReadInteger();
                ShapePtr = buffer.ReadInteger();
                SoundID  = buffer.ReadInteger();

                BlendPriority = buffer.ReadInteger();
                BlendType     = buffer.ReadInteger();

                Colors = new List <byte>(3);
                for (int i = 0; i < 3; ++i)
                {
                    Colors.Add(buffer.ReadByte());
                }

                CliffColors       = new Tuple <byte, byte>(buffer.ReadByte(), buffer.ReadByte());
                PassableTerrain   = buffer.ReadByte();
                ImpassableTerrain = buffer.ReadByte();

                IsAnimated        = buffer.ReadByte();
                AnimationFrames   = buffer.ReadShort();
                PauseFames        = buffer.ReadShort();
                Interval          = buffer.ReadFloat();
                PauseBetweenLoops = buffer.ReadFloat();
                Frame             = buffer.ReadShort();
                DrawFrame         = buffer.ReadShort();
                AnimateLast       = buffer.ReadFloat();
                FrameChanged      = buffer.ReadByte();
                Drawn             = buffer.ReadByte();

                ElevationGraphics = new List <FrameData>(19);
                for (int i = 0; i < 19; ++i)
                {
                    ElevationGraphics.Add(new FrameData().ReadData(buffer));
                }

                TerrainToDraw     = buffer.ReadShort();
                TerrainDimensions = new Tuple <short, short>(buffer.ReadShort(), buffer.ReadShort());

                Borders = new List <short>(TERRAIN_COUNT);
                for (int i = 0; i < TERRAIN_COUNT; ++i)
                {
                    Borders.Add(buffer.ReadShort());
                }

                TerrainUnitID = new List <short>(30);
                for (int i = 0; i < 30; ++i)
                {
                    TerrainUnitID.Add(buffer.ReadShort());
                }

                TerrainUnitDensity = new List <short>(30);
                for (int i = 0; i < 30; ++i)
                {
                    TerrainUnitDensity.Add(buffer.ReadShort());
                }

                TerrainUnitCentering = new List <byte>(30);
                for (int i = 0; i < 30; ++i)
                {
                    TerrainUnitCentering.Add(buffer.ReadByte());
                }

                NumberOfTerrainUnitsUsed = buffer.ReadShort();

                Phantom = buffer.ReadShort();

                return(this);
            }
Beispiel #20
0
        public TerrainBlock ReadData(RAMBuffer buffer)
        {
            VirtualFunctionPtr = buffer.ReadInteger();
            MapPointer         = buffer.ReadInteger();
            MapWidth           = buffer.ReadInteger();
            MapHeight          = buffer.ReadInteger();
            WorldWidth         = buffer.ReadInteger();
            WorldHeight        = buffer.ReadInteger();

            TileSizes = new List <TileSize>(19);
            for (int i = 0; i < 19; ++i)
            {
                TileSizes.Add(new TileSize().ReadData(buffer));
            }

            PaddingTS = buffer.ReadShort();

            Terrains = new List <Terrain>(TERRAIN_COUNT);
            for (int i = 0; i < TERRAIN_COUNT; ++i)
            {
                Terrains.Add(new Terrain().ReadData(buffer));
            }

            TerrainBorders = new List <TerrainBorder>(16);
            for (int i = 0; i < 16; ++i)
            {
                TerrainBorders.Add(new TerrainBorder().ReadData(buffer));
            }

            MapRowOffset = buffer.ReadInteger();
            MapMinX      = buffer.ReadFloat();
            MapMinY      = buffer.ReadFloat();
            MapMaxX      = buffer.ReadFloat();
            MapMaxY      = buffer.ReadFloat();
            MapMaxXplus1 = buffer.ReadFloat();
            MapMaxYplus1 = buffer.ReadFloat();

            TerrainsUsed2  = buffer.ReadUShort();
            BordersUsed    = buffer.ReadUShort();
            MaxTerrain     = buffer.ReadShort();
            TileWidth      = buffer.ReadShort();
            TileHeight     = buffer.ReadShort();
            TileHalfHeight = buffer.ReadShort();
            TileHalfWidth  = buffer.ReadShort();
            ElevHeight     = buffer.ReadShort();
            CurRow         = buffer.ReadShort();
            CurCol         = buffer.ReadShort();
            BlockBegRow    = buffer.ReadShort();
            BlockEndRow    = buffer.ReadShort();
            BlockBegCol    = buffer.ReadShort();
            BlockEndCol    = buffer.ReadShort();

            SearchMapPtr     = buffer.ReadInteger();
            SearchMapRowsPtr = buffer.ReadInteger();
            AnyFrameChange   = buffer.ReadByte();

            MapVisibleFlag = buffer.ReadByte();
            FogFlag        = buffer.ReadByte();

            SomeBytes = new List <byte>(21);
            for (int i = 0; i < 21; i++)
            {
                SomeBytes.Add(buffer.ReadByte());
            }

            SomeInt32 = new List <int>(157);
            for (int i = 0; i < 157; i++)
            {
                SomeInt32.Add(buffer.ReadInteger());
            }

            return(this);
        }