Exemplo n.º 1
0
        public void FailContainsMap()
        {
            var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_DIV));
            var map = new MAP(this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP));
            var fpg = new FPG(pal);

            fpg.Add(map); // Force palette conversion.

            Assert.IsFalse(fpg.Contains(map));
        }
Exemplo n.º 2
0
        public void ContainsMap()
        {
            var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_SPACE));
            var map = new MAP(this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP));
            var fpg = new FPG(pal);

            fpg.Add(map);

            Assert.IsTrue(fpg.Contains(map));
        }
Exemplo n.º 3
0
        public void FailRemoveMapByInstance()
        {
            var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_SPACE));
            var fpg = new FPG(pal);

            var a = new MAP(this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP));
            var b = MAP.FromImage(this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_BMP));

            fpg.Add(b);

            Assert.ThrowsException <ArgumentException>(() => fpg.Remove(a));
        }
Exemplo n.º 4
0
        public void AddMapWithTheSamePalette()
        {
            const string PLAYER_MAP_FILENAME_FIELD = "PLAYER.MAP";

            var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_SPACE));
            var map = new MAP(this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP));
            var fpg = new FPG(pal);

            fpg.Add(map, PLAYER_MAP_FILENAME_FIELD);

            Assert.AreEqual(pal, fpg.Palette);
            Assert.AreEqual(1, fpg.Count);
            Assert.AreEqual(map, fpg[0]);
            Assert.AreEqual(PLAYER_MAP_FILENAME_FIELD, fpg.GetFilename(0));
        }
Exemplo n.º 5
0
        public void AddMapWithDifferentPalette()
        {
            const string PLAYER_MAP_FILENAME_FIELD = "PLAYER.MAP";

            string playerMapPath = this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP);

            var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_DIV));
            var map = new MAP(playerMapPath);
            var fpg = new FPG(pal);

            fpg.Add(map, PLAYER_MAP_FILENAME_FIELD);

            Assert.AreEqual(pal, fpg.Palette);
            Assert.AreEqual(1, fpg.Count);
            Assert.AreEqual(PLAYER_MAP_FILENAME_FIELD, fpg.GetFilename(0));

            map = MAP.FromImage(playerMapPath, pal);
            Assert.AreEqual(map, fpg[0]);
        }