mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
3a5269cfea
* Removed MonoGame.Extended.Animations This project was just a shell that referenced MonoGame.Extended.csproj. It added no additional functionality. * Rework BitmapFonts for new project organization. * Cleanup namespaces * Cleanup namespaces * Move MonoGame.Extended.Collision into base project * Moved MonoGame.Extended.Entities into base project * Moved MonoGame.Extended.Graphics into base project * Moved MonoGame.Extended.Graphics into base project * Moved MonoGame.Extended.Input into base project * Moved MonoGame.Extended.Particles into base project * Moved MonoGame.Extended.Tiled into base project * Moved MonoGame.Extended.Tiled into base project * Moved MonoGame.Extended.Tweening into base project * Removing SpriteFactory support This will be added back in at a later date once the SpriteFactory application has been updated * Update TexturePacker content import support * Only needs to reference base project now * Moved to Serialization namespace * Moved Json serialization to Serialization.Json namespace * Moved TexturePacker content DTOs to the Content namespace * Renamed to Texture2DRegion.Extensions.cs * Cleaned up namespace * Moved ReadTiledMapProperties into the ContentReaderExtensions * Created an Extended content manager * Moved Tweening tests to base test project * Moved Tiled test to base test project * Moved Entities Tests to base test project * Moved Entities tests to base test project * Moved Collisions tests to base test project * Moved Pipeline Tiled test to Pipeline tests project * Use `var` instead of full type name * Add Tiled namespace * Correct `Metadata` property name to new `Meta` property name * Cleanup namespace * Add effects namespace * Add Content namespace * Update using statements to new namespaces * Move Pipeline Tiled tests to Pipeline test project * Use correct namespace * Use `var` instead of typing out nested types * Remove unused namespaces * Update to new namespaces * Remove unused namespaces * Update to new namespaces * Remove dependency on Particles csproj * Update included content on build * Add embedded resources * Merge multi csproj structure into single csproj structure * TexturePackerPoint properties should be `double` not `int` * Update csproj * Use dotnet tool to rebuild effects * Move effect compilation to targets file This will ensure the effects are always built * Fix workflow to build effects on linux * Set wine path * Export instead of using actions env section * Revert back to manual effect compile until automation can be solved on GitHub Ubuntu runner
131 lines
4.7 KiB
C#
131 lines
4.7 KiB
C#
//#region
|
|
|
|
//using Microsoft.Xna.Framework.Content.Pipeline;
|
|
//using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
|
|
//using Microsoft.Xna.Framework.Graphics;
|
|
//using MonoGame.Extended.Tests;
|
|
//using Xunit;
|
|
|
|
//#endregion
|
|
|
|
//namespace MonoGame.Extended.Tiled.Tests
|
|
//{
|
|
//
|
|
// public class TiledTilesetTests
|
|
// {
|
|
// [Fact]
|
|
// public void Constructor()
|
|
// {
|
|
// var graphicsDevice = TestHelper.CreateGraphicsDevice();
|
|
// var texture = new Texture2D(graphicsDevice, 64, 64);
|
|
|
|
// var tiledTileset = new TiledMapTileset(texture, 10, 32, 32, 4, 0, 0);
|
|
|
|
|
|
// //Assert.IsNull(tiledTileset.GetTileRegion(0));
|
|
// }
|
|
|
|
// [Fact]
|
|
// public void GetTileRegion_BlankTile()
|
|
// {
|
|
// var graphicsDevice = TestHelper.CreateGraphicsDevice();
|
|
// var texture = new Texture2D(graphicsDevice, 64, 64);
|
|
|
|
// var tiledTileset = new TiledTileset(texture, 10, 32, 32, 4, 0, 0);
|
|
|
|
|
|
// //Assert.IsNull(tiledTileset.GetTileRegion(0));
|
|
// }
|
|
|
|
// [Fact]
|
|
// [TestCase(9, Result = false, Description = "Too low")]
|
|
// [TestCase(10, Result = true, Description = "Min tile")]
|
|
// [TestCase(11, Result = true, Description = "Middle tile")]
|
|
// [TestCase(13, Result = true, Description = "Last tile")]
|
|
// [TestCase(14, Result = false, Description = "Too high")]
|
|
// public bool ContainsTileId(int id)
|
|
// {
|
|
// var graphicsDevice = TestHelper.CreateGraphicsDevice();
|
|
// var texture = new Texture2D(graphicsDevice, 64, 64);
|
|
|
|
// var tiledTileset = new TiledTileset(texture, 10, 32, 32, 4, 0, 0);
|
|
|
|
// return tiledTileset.ContainsTileId(id);
|
|
// }
|
|
|
|
// [Fact]
|
|
// public void Constructor_NoMargin([Values(0, 2)] int spacing)
|
|
// {
|
|
// var graphicsDevice = TestHelper.CreateGraphicsDevice();
|
|
// var texture = new Texture2D(graphicsDevice, 64, 64);
|
|
|
|
// var tiledTileset = new TiledTileset(texture, 1, 32, 32, 4, spacing, 0);
|
|
|
|
// var region = tiledTileset.GetTileRegion(1);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(0, region.X);
|
|
// Assert.Equal(0, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tiledTileset.GetTileRegion(2);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(spacing + 32, region.X);
|
|
// Assert.Equal(0, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tiledTileset.GetTileRegion(3);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(0, region.X);
|
|
// Assert.Equal(spacing + 32, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tiledTileset.GetTileRegion(4);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(spacing + 32, region.X);
|
|
// Assert.Equal(spacing + 32, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
// }
|
|
|
|
// [Fact]
|
|
// public void Constructor_NoSpacing([Values(0, 2)] int margin)
|
|
// {
|
|
// var graphicsDevice = TestHelper.CreateGraphicsDevice();
|
|
// var texture = new Texture2D(graphicsDevice, 64, 64);
|
|
|
|
// var tileset = new TiledTileset(texture, 1, 32, 32, 4, 0, margin);
|
|
|
|
// var region = tileset.GetTileRegion(1);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(margin, region.X);
|
|
// Assert.Equal(margin, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tileset.GetTileRegion(2);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(margin + 32, region.X);
|
|
// Assert.Equal(margin, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tileset.GetTileRegion(3);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(margin, region.X);
|
|
// Assert.Equal(margin + 32, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
|
|
// region = tileset.GetTileRegion(4);
|
|
// Assert.Equal(texture, region.Texture);
|
|
// Assert.Equal(margin + 32, region.X);
|
|
// Assert.Equal(margin + 32, region.Y);
|
|
// Assert.Equal(32, region.Width);
|
|
// Assert.Equal(32, region.Height);
|
|
// }
|
|
// }
|
|
//}
|