Example #1
0
        public DarkMountain(
            PaletteIndexCollectionBuilder builder1,
            PaletteIndexCollectionBuilder builder2)
        {
            if (builder1 is null)
            {
                throw new ArgumentNullException(nameof(builder1));
            }

            if (builder2 is null)
            {
                throw new ArgumentNullException(nameof(builder2));
            }

            builder1.AddBox(15, 0, 4, 3);
            builder1.AddRow(15, 6, 1);
            builder1.AddRow(17, 4, 3);
            builder1.AddColumn(45, 0, 2);
            builder1.AddRow(85, 0, 4);
            builder1.AddRow(85, 6, 1);
            builder1.AddRow(89, 0, 4);
            builder2.AddBox(0, 0, 4, 2);
            builder2.AddRow(1, 6, 1);
            builder2.AddRow(2, 0, 1);
            builder2.AddRow(4, 0, 4);
            WallsAndAbyss = FlushCombined();

            builder1.AddRow(15, 4, 2);
            builder1.AddRow(18, 5, 2);
            builder1.AddRow(19, 5, 1);
            builder1.AddColumn(45, 5, 3);
            builder1.AddRow(84, 5, 1);
            builder1.AddRow(89, 5, 1);
            builder2.AddRow(4, 5, 1);
            Ground = FlushCombined();

            builder1.AddRow(16, 4, 1);
            builder1.AddRow(16, 6, 1);
            builder1.AddRow(47, 4, 1);
            builder1.AddRow(47, 6, 1);
            builder1.AddRow(85, 5, 1);
            builder1.AddRow(87, 0, 5);
            builder1.AddRow(89, 4, 1);
            builder1.AddRow(89, 6, 1);
            PinkClouds = builder1.Flush();

            builder1.AddRow(-10, 4, 1);
            builder1.AddRow(-10, 6, 1);
            builder1.AddRow(86, 4, 1);
            builder1.AddRow(86, 6, 1);
            BlackClouds = builder1.Flush();

            builder1.AddRow(86, 3, 1);
            Lava = builder1.Flush();

            builder1.AddRow(-10, 5, 1);
            builder1.AddRow(16, 5, 1);
            builder1.AddRow(86, 0, 3);
            builder1.AddRow(86, 5, 1);
            LavaGround = builder1.Flush();

            builder1.AddRow(18, 0, 5);
            RocksAndGems = builder1.Flush();

            builder1.AddRow(19, 0, 5);
            builder1.AddRow(19, 6, 1);
            PostsAndSteaks = builder1.Flush();

            builder2.AddRow(0, 4, 3);
            builder2.AddRow(1, 5, 1);
            builder2.AddRow(2, 1, 6);
            builder2.AddRow(3, 4, 3);
            builder2.AddRow(4, 4, 1);
            builder2.AddRow(4, 6, 1);
            Lightning = builder2.Flush();

            builder1.AddBox(45, 1, 4, 2);
            builder1.AddColumn(45, 6, 2);
            builder1.AddRow(47, 1, 3);
            TurtleRockHead = builder1.Flush();

            builder1.AddRow(84, 0, 5);
            builder1.AddRow(84, 6, 1);
            TurtleRockLegs = builder1.Flush();

            builder1.AddRow(88, 1, 1);
            builder1.AddRow(88, 6, 1);
            GanonsTowerHighlight = builder1.Flush();

            builder1.AddRow(88, 0, 1);
            builder1.AddRow(88, 2, 4);
            GanonsTowerPrimary = builder1.Flush();

            AllIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                Ground,
                PinkClouds,
                BlackClouds,
                Lava,
                LavaGround,
                WallsAndAbyss,
                RocksAndGems,
                PostsAndSteaks,
                TurtleRockHead,
                TurtleRockLegs,
                Lightning,
                GanonsTowerPrimary,
                GanonsTowerHighlight,
            });

            MiscIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                Ground,
                PinkClouds,
                Lava,
                LavaGround,
                Lightning,
                RocksAndGems,
                PostsAndSteaks,
                TurtleRockHead,
                TurtleRockLegs,
                GanonsTowerHighlight,
            });

            IndexCollection FlushCombined()
            {
                var collection = builder1.ConvertBaseCollection().Concat(
                    builder2.ConvertBaseCollection());

                builder1.Clear();
                builder2.Clear();
                return(new ListIndexCollection(collection));
            }
        }
Example #2
0
        public DarkWorld(
            PaletteIndexCollectionBuilder objectBuilder,
            PaletteIndexCollectionBuilder spriteBuilder,
            PaletteIndexCollectionBuilder darkWorldSprites)
        {
            if (objectBuilder is null)
            {
                throw new ArgumentNullException(nameof(objectBuilder));
            }

            if (spriteBuilder is null)
            {
                throw new ArgumentNullException(nameof(spriteBuilder));
            }

            if (darkWorldSprites is null)
            {
                throw new ArgumentNullException(nameof(darkWorldSprites));
            }

            objectBuilder.AddRow(-8, 4, 1);
            objectBuilder.AddBox(5, 0, 4, 3);
            objectBuilder.AddColumn(5, 6, 2);
            objectBuilder.AddRow(7, 4, 3);
            objectBuilder.AddRow(65, 0, 1);
            objectBuilder.AddColumn(70, 0, 6);
            objectBuilder.AddRow(72, 1, 1);
            objectBuilder.AddRow(72, 6, 1);
            objectBuilder.AddRow(74, 1, 3);
            objectBuilder.AddRow(74, 6, 1);
            objectBuilder.AddColumn(77, 0, 2);
            objectBuilder.AddColumn(82, 0, 1);
            HillsAndDirt = objectBuilder.Flush();

            objectBuilder.AddRow(5, 4, 2);
            objectBuilder.AddBox(8, 4, 3, 2);
            objectBuilder.AddRow(9, 0, 1);
            objectBuilder.AddRow(9, 3, 1);
            objectBuilder.AddBox(72, 4, 2, 3);
            objectBuilder.AddRow(79, 5, 2);
            var list = new List <int>(objectBuilder.Flush())
            {
                0x5FEB3
            };

            spriteBuilder.AddRow(8, 2, 2);
            list.AddRange(spriteBuilder.Flush());
            darkWorldSprites.AddRow(0, 2, 3);
            list.AddRange(darkWorldSprites.Flush());
            GrassShrubsAndTrees = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(6, 4, 2);
            objectBuilder.AddRow(65, 5, 2);
            objectBuilder.AddRow(71, 3, 3);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddRow(9, 2, 2);
            list.AddRange(spriteBuilder.Flush());
            DryGrassAndSand = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(-8, 0, 4);
            objectBuilder.AddRow(-8, 5, 1);
            objectBuilder.AddRow(69, 5, 1);
            objectBuilder.AddRow(70, 1, 1);
            objectBuilder.AddRow(71, 1, 2);
            objectBuilder.AddRow(71, 6, 1);
            objectBuilder.AddRow(72, 2, 2);
            objectBuilder.AddRow(73, 1, 1);
            objectBuilder.AddRow(73, 6, 1);
            list.AddRange(objectBuilder.Flush());
            darkWorldSprites.AddRow(1, 0, 4);
            darkWorldSprites.AddRow(1, 5, 2);
            list.AddRange(darkWorldSprites.Flush());
            Water = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(8, 0, 4);
            objectBuilder.AddRow(79, 0, 5);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddBox(8, 0, 2, 2);
            spriteBuilder.AddBox(8, 5, 2, 2);
            list.AddRange(spriteBuilder.Flush());
            FlowersAndRocks = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(9, 1, 2);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddRow(8, 4, 1);
            list.AddRange(spriteBuilder.Flush());
            SignsPostsAndBushes = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(81, 0, 7);
            PyramidBG = objectBuilder.Flush();

            objectBuilder.AddRow(83, 0, 7);
            Pyramid = objectBuilder.Flush();

            objectBuilder.AddRow(69, 0, 5);
            objectBuilder.AddRow(69, 6, 1);
            IcePalaceEntrance = objectBuilder.Flush();

            objectBuilder.AddRow(78, 1, 3);
            HouseStructure = objectBuilder.Flush();

            objectBuilder.AddRow(78, 4, 3);
            Houses = objectBuilder.Flush();

            objectBuilder.AddRow(64, 0, 4);
            objectBuilder.AddRow(76, 0, 4);
            objectBuilder.AddRow(80, 0, 4);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddRow(-9, 1, 1);
            spriteBuilder.AddRow(-9, 4, 3);
            list.AddRange(spriteBuilder.Flush());
            TreeWood = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(80, 4, 3);
            Trees = objectBuilder.Flush();

            objectBuilder.AddRow(64, 4, 3);
            YellowTrees = objectBuilder.Flush();

            objectBuilder.AddRow(76, 4, 3);
            PinkTrees = objectBuilder.Flush();

            objectBuilder.AddRow(82, 4, 3);
            PurpleTrees = objectBuilder.Flush();

            PalaceOfDarkness = new PalaceOfDarkness(objectBuilder);
            SkullWoods       = new SkullWoods(objectBuilder);
            ThievesTown      = new ThievesTown(objectBuilder);
            Swamp            = new Swamp(objectBuilder);
            DarkMountain     = new DarkMountain(
                objectBuilder,
                new PaletteIndexCollectionBuilder(0x3F97B, 7));

            AllIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                YellowTrees,
                SignsPostsAndBushes,
                FlowersAndRocks,
                DryGrassAndSand,
                HillsAndDirt,
                GrassShrubsAndTrees,
                TreeWood,
                IcePalaceEntrance,
                Water,
                PurpleTrees,
                Pyramid,
                PyramidBG,
                PinkTrees,
                HouseStructure,
                Houses,
                Trees,
            });

            MiscIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                YellowTrees,
                SignsPostsAndBushes,
                DryGrassAndSand,
                PurpleTrees,
                PyramidBG,
                PinkTrees,
                HouseStructure,
                Trees,
            });
        }
        public LightWorld(
            PaletteIndexCollectionBuilder objectBuilder,
            PaletteIndexCollectionBuilder spriteBuilder,
            PaletteIndexCollectionBuilder lightWorldSprites)
        {
            if (objectBuilder is null)
            {
                throw new ArgumentNullException(nameof(objectBuilder));
            }

            if (spriteBuilder is null)
            {
                throw new ArgumentNullException(nameof(spriteBuilder));
            }

            if (lightWorldSprites is null)
            {
                throw new ArgumentNullException(nameof(lightWorldSprites));
            }

            objectBuilder.AddRow(-7, 0, 1);
            objectBuilder.AddRow(-7, 4, 1);
            objectBuilder.AddRow(-7, 6, 1);
            objectBuilder.AddBox(0, 0, 4, 3);
            objectBuilder.AddColumn(0, 6, 2);
            objectBuilder.AddRow(2, 4, 3);
            objectBuilder.AddRow(30, 0, 1);
            objectBuilder.AddColumn(33, 0, 5);
            objectBuilder.AddRow(42, 0, 2);
            objectBuilder.AddRow(42, 6, 1);
            objectBuilder.AddRow(43, 0, 1);
            objectBuilder.AddRow(44, 0, 4);
            objectBuilder.AddRow(44, 6, 1);
            objectBuilder.AddRow(53, 3, 1);
            objectBuilder.AddColumn(55, 0, 5);
            objectBuilder.AddRow(57, 5, 2);
            HillsAndDirt = objectBuilder.Flush();

            objectBuilder.AddRow(0, 4, 2);
            objectBuilder.AddBox(3, 4, 3, 2);
            objectBuilder.AddBox(25, 0, 7, 5);
            objectBuilder.AddRow(31, 5, 2);
            objectBuilder.AddRow(32, 0, 1);
            objectBuilder.AddRow(32, 4, 3);
            objectBuilder.AddRow(34, 3, 1);
            objectBuilder.AddRow(34, 5, 1);
            objectBuilder.AddRow(35, 4, 3);
            objectBuilder.AddRow(38, 4, 2);
            objectBuilder.AddBox(42, 4, 2, 3);
            objectBuilder.AddRow(53, 0, 3);
            objectBuilder.AddRow(53, 5, 1);
            objectBuilder.AddRow(54, 0, 1);
            objectBuilder.AddColumn(54, 4, 2);
            objectBuilder.AddRow(60, 6, 1);
            objectBuilder.AddRow(62, 0, 1);
            objectBuilder.AddRow(62, 2, 5);
            objectBuilder.AddRow(61, 0, 7);
            var list = new List <int>(objectBuilder.Flush())
            {
                -0x1199C,
                -0x17F7E,
                -0x5FEE7,
                0x5FEA9,
                0x67FC6,
                0x67FE1,
                0x67FE6,
            };

            spriteBuilder.AddRow(6, 2, 2);
            spriteBuilder.AddRow(-11, 1, 1);
            spriteBuilder.AddRow(-11, 4, 3);
            list.AddRange(spriteBuilder.Flush());
            lightWorldSprites.AddRow(0, 2, 3);
            list.AddRange(lightWorldSprites.Flush());
            GrassShrubsAndTrees = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(1, 4, 2);
            objectBuilder.AddRow(32, 1, 3);
            objectBuilder.AddRow(34, 1, 2);
            objectBuilder.AddRow(55, 1, 2);
            objectBuilder.AddRow(58, 1, 6);
            objectBuilder.AddRow(59, 5, 2);
            objectBuilder.AddRow(62, 1, 1);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddRow(7, 2, 2);
            list.AddRange(spriteBuilder.Flush());
            DryGrassAndSand = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(-7, 1, 3);
            objectBuilder.AddRow(-7, 5, 1);
            objectBuilder.AddRow(42, 2, 2);
            objectBuilder.AddRow(43, 1, 1);
            objectBuilder.AddRow(43, 6, 1);
            objectBuilder.AddRow(60, 0, 6);
            list.AddRange(objectBuilder.Flush());
            lightWorldSprites.AddRow(1, 0, 4);
            lightWorldSprites.AddRow(1, 5, 2);
            lightWorldSprites.AddColumn(8, 14, 4);
            list.AddRange(lightWorldSprites.Flush());
            Water = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(3, 0, 4);
            objectBuilder.AddRow(31, 0, 5);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddBox(6, 0, 2, 2);
            spriteBuilder.AddBox(6, 5, 2, 2);
            list.AddRange(spriteBuilder.Flush());
            FlowersAndRocks = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(4, 0, 4);
            list.AddRange(objectBuilder.Flush());
            spriteBuilder.AddColumn(6, 4, 2);
            list.AddRange(spriteBuilder.Flush());
            SignsAndPosts = new ListIndexCollection(list);
            list.Clear();

            objectBuilder.AddRow(43, 2, 2);
            CaveCrest = objectBuilder.Flush();

            objectBuilder.AddRow(30, 1, 6);
            objectBuilder.AddRow(56, 1, 3);
            objectBuilder.AddRow(56, 6, 1);
            Houses = objectBuilder.Flush();

            objectBuilder.AddRow(34, 4, 1);
            objectBuilder.AddRow(34, 6, 1);
            RedTree = objectBuilder.Flush();

            objectBuilder.AddRow(35, 1, 3);
            Tombstone = objectBuilder.Flush();

            objectBuilder.AddRow(57, 1, 3);
            objectBuilder.AddRow(59, 1, 4);
            Palace = objectBuilder.Flush();

            objectBuilder.AddRow(57, 4, 1);
            DesertPrayerFloor = objectBuilder.Flush();

            objectBuilder.AddRow(-9, 1, 3);
            WarpTile = objectBuilder.Flush();

            HyruleCastle  = new HyruleCastle(objectBuilder);
            Sanctuary     = new Sanctuary(objectBuilder);
            Kakariko      = new Kakariko(objectBuilder);
            DeathMountain = new DeathMountain(objectBuilder);

            AllIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                GrassShrubsAndTrees,
                HillsAndDirt,
                Water,
                RedTree,
                Houses,
                Tombstone,
                CaveCrest,
                DryGrassAndSand,
                FlowersAndRocks,
                SignsAndPosts,
                Palace,
                DesertPrayerFloor,
                WarpTile,
            });

            MiscIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                RedTree,
                Tombstone,
                CaveCrest,
                DryGrassAndSand,
                SignsAndPosts,
                Palace,
                DesertPrayerFloor,
                WarpTile,
            });
        }
Example #4
0
        public DeathMountain(PaletteIndexCollectionBuilder builder)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddRow(-9, 0, 1);
            builder.AddBox(10, 0, 4, 3);
            builder.AddRow(10, 6, 1);
            builder.AddRow(12, 4, 3);
            builder.AddRow(49, 5, 2);
            builder.AddBox(51, 0, 4, 2);
            builder.AddColumn(51, 6, 2);
            WallsAndAbyss = builder.Flush();

            builder.AddRow(10, 4, 2);
            builder.AddBox(13, 4, 2, 2);
            builder.AddRow(51, 4, 2);
            Ground = builder.Flush();

            builder.AddRow(-9, 4, 1);
            builder.AddRow(-9, 6, 1);
            builder.AddRow(11, 4, 3);
            builder.AddRow(50, 4, 1);
            builder.AddRow(50, 6, 1);
            builder.AddRow(52, 4, 2);
            builder.AddRow(53, 4, 1);
            builder.AddRow(53, 6, 1);
            Clouds = builder.Flush();

            builder.AddRow(50, 0, 4);
            Bridge = builder.Flush();

            builder.AddRow(13, 0, 4);
            RocksAndGems = builder.Flush();

            builder.AddRow(14, 0, 4);
            builder.AddRow(14, 6, 1);
            PostsAndSteaks = builder.Flush();

            builder.AddRow(49, 0, 4);
            HeraStone = builder.Flush();

            builder.AddRow(49, 4, 1);
            HeraBricks = builder.Flush();

            AllIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                WallsAndAbyss,
                Ground,
                Clouds,
                RocksAndGems,
                PostsAndSteaks,
                Bridge,
                HeraBricks,
                HeraStone,
            });

            MiscIndexCollections = new ReadOnlyCollection <IndexCollection>(
                new IndexCollection[]
            {
                Ground,
                RocksAndGems,
                PostsAndSteaks,
                Bridge,
                HeraStone,
            });
        }