Esempio n. 1
0
        public void BoolTest()
        {
            var btw = new BinaryTextWriter();

            btw.AddBool(true);
            btw.AddBool(false);
            var btr = new BinaryTextReader(btw.GetOutputString());

            Assert.IsTrue(btr.ReadBool());
            Assert.IsFalse(btr.ReadBool());
        }
Esempio n. 2
0
        private void LoadSettings_1_3_2(BinaryTextReader btr)
        {
            // items
            bool randAbilities = btr.ReadBool();
            bool randTanks     = btr.ReadBool();

            if (randAbilities && randTanks)
            {
                AbilitySwap = Swap.GlobalPool;
                TankSwap    = Swap.GlobalPool;
            }
            else if (randAbilities)
            {
                AbilitySwap = Swap.LocalPool;
            }
            else if (randTanks)
            {
                TankSwap = Swap.LocalPool;
            }

            if (btr.ReadBool())
            {
                NumItemsRemoved = btr.ReadNumber(7);
            }
            if (SwapOrRemoveItems)
            {
                Completion          = (GameCompletion)btr.ReadNumber(2);
                IceNotRequired      = btr.ReadBool();
                PlasmaNotRequired   = btr.ReadBool();
                NoPBsBeforeChozodia = btr.ReadBool();
                ChozoStatueHints    = btr.ReadBool();
                InfiniteBombJump    = btr.ReadBool();
                WallJumping         = btr.ReadBool();
            }

            // locations
            if (btr.ReadBool())
            {
                int count = btr.ReadNumber(7);
                for (int i = 0; i < count; i++)
                {
                    int      locNum = btr.ReadNumber(7);
                    ItemType item   = (ItemType)btr.ReadNumber(5);
                    CustomAssignments[locNum] = item;
                }
            }

            // enemies
            RandoEnemies = btr.ReadBool();

            // palettes
            TilesetPalettes = btr.ReadBool();
            EnemyPalettes   = btr.ReadBool();
            BeamPalettes    = btr.ReadBool();
            if (RandomPalettes)
            {
                if (btr.ReadBool())
                {
                    HueMinimum = btr.ReadNumber(8);
                }
                if (btr.ReadBool())
                {
                    HueMaximum = btr.ReadNumber(8);
                }
            }

            // misc
            EnableItemToggle    = btr.ReadBool();
            ObtainUnkItems      = btr.ReadBool();
            HardModeAvailable   = btr.ReadBool();
            PauseScreenInfo     = btr.ReadBool();
            RemoveCutscenes     = btr.ReadBool();
            SkipSuitless        = btr.ReadBool();
            SkipDoorTransitions = btr.ReadBool();
        }
Esempio n. 3
0
        private void LoadSettings(BinaryTextReader btr)
        {
            // items
            AbilitySwap = (Swap)btr.ReadNumber(2);
            TankSwap    = (Swap)btr.ReadNumber(2);
            if (btr.ReadBool())
            {
                NumItemsRemoved = btr.ReadNumber(7);
                if (btr.ReadBool())
                {
                    NumAbilitiesRemoved = btr.ReadNumber(4);
                }
            }
            if (SwapOrRemoveItems)
            {
                Completion          = (GameCompletion)btr.ReadNumber(2);
                IceNotRequired      = btr.ReadBool();
                PlasmaNotRequired   = btr.ReadBool();
                NoPBsBeforeChozodia = btr.ReadBool();
                ChozoStatueHints    = btr.ReadBool();
                InfiniteBombJump    = btr.ReadBool();
                WallJumping         = btr.ReadBool();
            }

            // locations
            if (btr.ReadBool())
            {
                int count = btr.ReadNumber(7);
                for (int i = 0; i < count; i++)
                {
                    int      locNum = btr.ReadNumber(7);
                    ItemType item   = (ItemType)btr.ReadNumber(5);
                    CustomAssignments[locNum] = item;
                }
            }

            // enemies
            RandoEnemies = btr.ReadBool();

            // palettes
            TilesetPalettes = btr.ReadBool();
            EnemyPalettes   = btr.ReadBool();
            SamusPalettes   = btr.ReadBool();
            BeamPalettes    = btr.ReadBool();
            if (RandomPalettes)
            {
                if (btr.ReadBool())
                {
                    HueMinimum = btr.ReadNumber(8);
                }
                if (btr.ReadBool())
                {
                    HueMaximum = btr.ReadNumber(8);
                }
            }

            // music
            MusicChange = (Change)btr.ReadNumber(2);
            if (MusicChange != Change.Unchanged)
            {
                MusicRooms  = (Swap)btr.ReadNumber(2);
                MusicBosses = (Swap)btr.ReadNumber(2);
                MusicOthers = (Swap)btr.ReadNumber(2);
            }

            // misc
            EnableItemToggle    = btr.ReadBool();
            ObtainUnkItems      = btr.ReadBool();
            HardModeAvailable   = btr.ReadBool();
            PauseScreenInfo     = btr.ReadBool();
            RemoveCutscenes     = btr.ReadBool();
            SkipSuitless        = btr.ReadBool();
            SkipDoorTransitions = btr.ReadBool();
        }
Esempio n. 4
0
        private void LoadSettings(BinaryTextReader btr)
        {
            // items
            randomAbilities = btr.ReadBool();
            randomTanks     = btr.ReadBool();

            // excluded items
            excludedItems = new List <int>();
            for (int i = 0; i < 100; i++)
            {
                bool excluded = btr.ReadBool();
                if (excluded)
                {
                    excludedItems.Add(i);
                }
            }

            gameCompletion      = (GameCompletion)btr.ReadNumber(2);
            iceNotRequired      = btr.ReadBool();
            plasmaNotRequired   = btr.ReadBool();
            noPBsBeforeChozodia = btr.ReadBool();
            chozoStatueHints    = btr.ReadBool();
            infiniteBombJump    = btr.ReadBool();
            wallJumping         = btr.ReadBool();

            // palettes
            tilesetPalettes = btr.ReadBool();
            enemyPalettes   = btr.ReadBool();
            beamPalettes    = btr.ReadBool();
            hueMinimum      = btr.ReadNumber(8);
            hueMaximum      = btr.ReadNumber(8);

            // misc
            enableItemToggle     = btr.ReadBool();
            obtainUnkItems       = btr.ReadBool();
            hardModeAvailable    = btr.ReadBool();
            pauseScreenInfo      = btr.ReadBool();
            removeCutscenes      = btr.ReadBool();
            removeNorfairVine    = btr.ReadBool();
            removeVariaAnimation = btr.ReadBool();
            skipSuitless         = btr.ReadBool();
        }