Ejemplo n.º 1
0
            /// <summary>
            /// Convert an instance of this class into a byte-array representation inside the .exbin-format
            /// </summary>
            /// <param name="bytesLeft">How much bytes we can occupy for this order at max</param>
            public void SerializeExbin(ref List <byte> target, int bytesLeft)
            {
                Debug.Assert(bytesLeft >= 3, "No bytes left for 'unknown'");
                target.AddRange(unknown);

                Debug.Assert(bytesLeft >= 1, "No bytes left for 'ID'");
                target.Add(_ID);

                Debug.Assert(bytesLeft >= 64, "No bytes left for 'unknown2'");
                target.AddRange(unknown2);

                fruitType.SerializeExbin(ref target, fruitType_LENGTH);

                Debug.Assert(bytesLeft >= 13, "No bytes left for 'unknown3'");
                target.AddRange(unknown3);
            }
Ejemplo n.º 2
0
            public void SerializeExbin(ref List <byte> serializedData, int bytesLeft)
            {
                serializedData.AddRange(tutorialText1);
                serializedData.AddRange(tutorialText2);
                serializedData.AddRange(tutorialTextbuffer);

                serializedData.AddRange(unknownCP);
                serializedData.AddRange(unknownPostCP);
                serializedData.Add((byte)(_ID == 99 ? 0 : ++_ID));
                backgroundID.SerializeExbin(ref serializedData, backgroundID_LENGTH);
                notDoor.SerializeExbin(ref serializedData, notDoor_LENGTH);
                teleportIndices.SerializeExbin(ref serializedData, teleportIndices_LENGTH);

                foreach (byte key in HOLE_DEFINITION_KEYS)
                {
                    serializedData.Add((byte)holeDefinitions[key]);
                    for (int i = 0; i < holeDefinitions_LENGTH - 1; i++)
                    {
                        serializedData.Add(0x00);
                    }
                }

                for (int contentFlagIndex = 0; contentFlagIndex < MAXIMUM_CONTENT_FLAGS; contentFlagIndex++)
                {
                    if (contentFlagIndex < contentFlags.Count)
                    {
                        serializedData.Add((byte)contentFlags[contentFlagIndex]);
                        if (contentFlagIndex + 1 < contentFlags.Count)
                        {
                            serializedData.Add(0x20);
                        }
                        else
                        {
                            serializedData.Add(0x00);
                        }
                    }
                    else
                    {
                        serializedData.Add(0x00);
                        serializedData.Add(0x00);
                    }
                }

                for (int switchOrPepperIndex = 0; switchOrPepperIndex < SWITCHORPEPPER_DEFINITIONS; switchOrPepperIndex++)
                {
                    serializedData.Add((byte)switchOrPepperDefinitions[switchOrPepperIndex]);
                    for (int i = 0; i < switchOrPepperDefinitions_LENGTH - 1; i++)
                    {
                        serializedData.Add(0x00);
                    }
                }

                for (int patternIndex = 0; patternIndex < MOVEMENTPATTERN_DEFINITIONS; patternIndex++)
                {
                    movementPatterns[patternIndex].SerializeExbin(ref serializedData, movementPattern_LENGTH);
                }

                for (int FDefinitionIndex = 0; FDefinitionIndex < FRUIT_ORDER_DEFINITIONS; FDefinitionIndex++)
                {
                    orderedFruitDefinition[FDefinitionIndex].SerializeExbin(ref serializedData, orderedFruitDefinition_LENGTH);
                }

                for (int fruitAssociationIndex = 0; fruitAssociationIndex < FRUIT_ASSOCIATIONS_DEFINITIONS; fruitAssociationIndex++)
                {
                    fruitAssociations[fruitAssociationIndex].SerializeExbin(ref serializedData, fruitAssociations_LENGTH);
                }
            }