diff --git a/docs/docs/essentials/custom-properties.md b/docs/docs/essentials/custom-properties.md index 934882c..b18ba7f 100644 --- a/docs/docs/essentials/custom-properties.md +++ b/docs/docs/essentials/custom-properties.md @@ -4,40 +4,40 @@ ## All classes that can contain properties -All classes that can contain custom properties implement the interface in some way. Below is an exhaustive list of all classes that can contain custom properties: +All classes that can contain custom properties implement the interface in some way. Below is an exhaustive list of all classes that can contain custom properties: -- - - - - - - - - -- (allows for recursive property objects) -- (used to define custom Tiled property types) -- - - - - - - - - - - - - - - -- -- -- -- +- + - + - + - + - +- (allows for recursive property objects) +- (used to define custom Tiled property types) +- + - + - + - + - + - + - + - +- +- +- +- ## How to access properties -To access the properties on one of the classes listed above, you will make use of the interface. +To access the properties on one of the classes listed above, you will make use of the interface. -In situations where you know that a property must exist, and you simply want to retrieve it, you can use the method like so: +In situations where you know that a property must exist, and you simply want to retrieve it, you can use the method like so: ```csharp var map = LoadMap(); var propertyValue = map.GetProperty("boolPropertyInMap").Value; ``` -If you are unsure whether a property exists, or you want to provide some kind of default behaviour if the property is not present, you can instead use the method like so: +If you are unsure whether a property exists, or you want to provide some kind of default behaviour if the property is not present, you can instead use the method like so: ```csharp var map = LoadMap(); @@ -56,17 +56,17 @@ For both methods, you can replace `BoolProperty` with any of the property types ## All types of properties -Tiled supports a variety of property types, which are represented in the DotTiled library as classes that implement the interface. Below is a list of all property types that Tiled supports and their corresponding classes in DotTiled: +Tiled supports a variety of property types, which are represented in the DotTiled library as classes that implement the interface. Below is a list of all property types that Tiled supports and their corresponding classes in DotTiled: -- `bool` - -- `color` - -- `float` - -- `file` - -- `int` - -- `object` - -- `string` - +- `bool` - +- `color` - +- `float` - +- `file` - +- `int` - +- `object` - +- `string` - -In addition to these primitive property types, [Tiled also supports more complex property types](https://doc.mapeditor.org/en/stable/manual/custom-properties/#custom-types). These custom property types are defined in Tiled according to the linked documentation, and to work with them in DotTiled, you *must* define their equivalences as a . You must then provide a resolving function to a defined type given a custom type name, as it is defined in Tiled. +In addition to these primitive property types, [Tiled also supports more complex property types](https://doc.mapeditor.org/en/stable/manual/custom-properties/#custom-types). These custom property types are defined in Tiled according to the linked documentation, and to work with them in DotTiled, you *must* define their equivalences as a . You must then provide a resolving function to a defined type given a custom type name, as it is defined in Tiled. ## Custom types @@ -74,7 +74,7 @@ Tiled allows you to define custom property types that can be used in your maps. ### Class properties -Whenever DotTiled encounters a property that is of type `class` in a Tiled file, it will use the supplied custom type resolver function to retrieve the custom type definition. It will then use that definition to know the default values of the properties of that class, and then override those defaults with the values found in the Tiled file when populating a instance. `class` properties allow you to create hierarchical structures of properties. +Whenever DotTiled encounters a property that is of type `class` in a Tiled file, it will use the supplied custom type resolver function to retrieve the custom type definition. It will then use that definition to know the default values of the properties of that class, and then override those defaults with the values found in the Tiled file when populating a instance. `class` properties allow you to create hierarchical structures of properties. For example, if you have a `class` property in Tiled that looks like this: @@ -98,7 +98,7 @@ var monsterSpawnerDefinition = new CustomClassDefinition ### Enum properties -Tiled also allows you to define custom property types that work as enums. Similarly to `class` properties, you must define the equivalent in DotTiled as a . You can then return the corresponding definition in the resolving function. +Tiled also allows you to define custom property types that work as enums. Similarly to `class` properties, you must define the equivalent in DotTiled as a . You can then return the corresponding definition in the resolving function. For example, if you have a custom property type in Tiled that looks like this: @@ -125,9 +125,9 @@ var entityTypeDefinition = new CustomEnumDefinition In the future, DotTiled will support automatically mapping custom property `class` types to C# classes. This will allow you to define a C# class that matches the structure of the `class` property in Tiled, and DotTiled will automatically map the properties of the `class` property to the properties of the C# class. This will make working with `class` properties much easier and more intuitive. -The idea is to expand on the interface with a method like `GetMappedProperty(string propertyName)`, where `T` is a class that matches the structure of the `class` property in Tiled. +The idea is to expand on the interface with a method like `GetMappedProperty(string propertyName)`, where `T` is a class that matches the structure of the `class` property in Tiled. -This functionality would be accompanied by a way to automatically create a matching given a C# class or enum. Something like this would then be possible: +This functionality would be accompanied by a way to automatically create a matching given a C# class or enum. Something like this would then be possible: ```csharp class MonsterSpawner @@ -156,6 +156,6 @@ var monsterSpawner = map.GetMappedProperty("monsterSpawnerProper var entityType = map.GetMappedProperty("entityTypePropertyInMap"); ``` -Finally, it might be possible to also make some kind of exporting functionality for . Given a collection of custom type definitions, DotTiled could generate a corresponding `propertytypes.json` file that you then can import into Tiled. This would make it so that you only have to define your custom property types once (in C#) and then import them into Tiled to use them in your maps. +Finally, it might be possible to also make some kind of exporting functionality for . Given a collection of custom type definitions, DotTiled could generate a corresponding `propertytypes.json` file that you then can import into Tiled. This would make it so that you only have to define your custom property types once (in C#) and then import them into Tiled to use them in your maps. Depending on implementation this might become something that can inhibit native AOT compilation due to potential reflection usage. Source generators could be used to mitigate this, but it is not yet clear how this will be implemented. \ No newline at end of file diff --git a/docs/docs/essentials/loading-maps.md b/docs/docs/essentials/loading-maps.md index c1598ec..b34b964 100644 --- a/docs/docs/essentials/loading-maps.md +++ b/docs/docs/essentials/loading-maps.md @@ -1,9 +1,9 @@ # Loading maps -Loading maps with DotTiled is straightforward and easy. The class is a representation of a Tiled map, mimicking the structure of a Tiled map file. Map files can either be in the [`.tmx`/XML](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/) or [`.tmj`/json](https://doc.mapeditor.org/en/stable/reference/json-map-format/) format. DotTiled supports **both** formats fully. +Loading maps with DotTiled is straightforward and easy. The class is a representation of a Tiled map, mimicking the structure of a Tiled map file. Map files can either be in the [`.tmx`/XML](https://doc.mapeditor.org/en/stable/reference/tmx-map-format/) or [`.tmj`/json](https://doc.mapeditor.org/en/stable/reference/json-map-format/) format. DotTiled supports **both** formats fully. > [!NOTE] -> Using the `.tmj` file format will result in not having the same amount of information as for the `.tmx` format. This is due to the fact that the `.tmj` format does not include the full information that the `.tmx` format does. This is not a problem with DotTiled, but rather a limitation of the `.tmj` format. +> Using the `.tmj` file format will result in not having the same amount of information as for the `.tmx` format. This is due to the fact that the `.tmj` format does not include the full information that the `.tmx` format does. This is not a problem with DotTiled, but rather a limitation of the `.tmj` format. ## External resolution @@ -13,7 +13,7 @@ Loading a map, tileset, or template will require you to specify **three** resolv ### `Func` - Tileset resolver -This function is used to resolve external tilesets by their source path. The function should return a instance given the source path of the tileset. If you just want to load tilesets from the file system, you can use something like this: +This function is used to resolve external tilesets by their source path. The function should return a instance given the source path of the tileset. If you just want to load tilesets from the file system, you can use something like this: ```csharp Tileset ResolveTileset(string source) @@ -38,11 +38,11 @@ Tileset ResolveTileset(string source) ### `Func` - Template resolver -This function is used to resolve external object templates by their source path. The function should return a instance given the source path of the template. If you just want to load templates from the file system, you can use something very similar to the tileset resolver by replacing with . +This function is used to resolve external object templates by their source path. The function should return a instance given the source path of the template. If you just want to load templates from the file system, you can use something very similar to the tileset resolver by replacing with . ### `Func` - Custom type resolver -This function is used to resolve custom types that are defined in Tiled maps. Please refer to the [custom properties](custom-properties.md) documentation for more information on custom types. The function should return a instance given the custom type's name. +This function is used to resolve custom types that are defined in Tiled maps. Please refer to the [custom properties](custom-properties.md) documentation for more information on custom types. The function should return a instance given the custom type's name. ## Putting it all together diff --git a/src/DotTiled.Benchmark/Program.cs b/src/DotTiled.Benchmark/Program.cs index 523a7f1..40e695b 100644 --- a/src/DotTiled.Benchmark/Program.cs +++ b/src/DotTiled.Benchmark/Program.cs @@ -35,7 +35,7 @@ namespace DotTiled.Benchmark [BenchmarkCategory("MapFromInMemoryTmxString")] [Benchmark(Baseline = true, Description = "DotTiled")] - public DotTiled.Model.Map LoadWithDotTiledFromInMemoryTmxString() + public DotTiled.Map LoadWithDotTiledFromInMemoryTmxString() { using var stringReader = new StringReader(_tmxContents); using var xmlReader = XmlReader.Create(stringReader); @@ -45,7 +45,7 @@ namespace DotTiled.Benchmark [BenchmarkCategory("MapFromInMemoryTmjString")] [Benchmark(Baseline = true, Description = "DotTiled")] - public DotTiled.Model.Map LoadWithDotTiledFromInMemoryTmjString() + public DotTiled.Map LoadWithDotTiledFromInMemoryTmjString() { using var mapReader = new DotTiled.Serialization.Tmj.TmjMapReader(_tmjContents, _ => throw new NotSupportedException(), _ => throw new NotSupportedException(), _ => throw new NotSupportedException()); return mapReader.ReadMap(); diff --git a/src/DotTiled.Tests/Assert/AssertData.cs b/src/DotTiled.Tests/Assert/AssertData.cs index 3ddcf4a..31ffff2 100644 --- a/src/DotTiled.Tests/Assert/AssertData.cs +++ b/src/DotTiled.Tests/Assert/AssertData.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert diff --git a/src/DotTiled.Tests/Assert/AssertImage.cs b/src/DotTiled.Tests/Assert/AssertImage.cs index 51a9b82..a674faa 100644 --- a/src/DotTiled.Tests/Assert/AssertImage.cs +++ b/src/DotTiled.Tests/Assert/AssertImage.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert diff --git a/src/DotTiled.Tests/Assert/AssertLayer.cs b/src/DotTiled.Tests/Assert/AssertLayer.cs index 89886cc..5432d62 100644 --- a/src/DotTiled.Tests/Assert/AssertLayer.cs +++ b/src/DotTiled.Tests/Assert/AssertLayer.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert diff --git a/src/DotTiled.Tests/Assert/AssertMap.cs b/src/DotTiled.Tests/Assert/AssertMap.cs index 358029b..0110f51 100644 --- a/src/DotTiled.Tests/Assert/AssertMap.cs +++ b/src/DotTiled.Tests/Assert/AssertMap.cs @@ -1,6 +1,5 @@ using System.Collections; using System.Numerics; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Assert/AssertObject.cs b/src/DotTiled.Tests/Assert/AssertObject.cs index bc8e54c..2dfb2d9 100644 --- a/src/DotTiled.Tests/Assert/AssertObject.cs +++ b/src/DotTiled.Tests/Assert/AssertObject.cs @@ -1,22 +1,22 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert { - internal static void AssertObject(Model.Object expected, Model.Object actual) + internal static void AssertObject(DotTiled.Object expected, DotTiled.Object actual) { // Attributes - AssertEqual(expected.ID, actual.ID, nameof(Model.Object.ID)); - AssertEqual(expected.Name, actual.Name, nameof(Model.Object.Name)); - AssertEqual(expected.Type, actual.Type, nameof(Model.Object.Type)); - AssertEqual(expected.X, actual.X, nameof(Model.Object.X)); - AssertEqual(expected.Y, actual.Y, nameof(Model.Object.Y)); - AssertEqual(expected.Width, actual.Width, nameof(Model.Object.Width)); - AssertEqual(expected.Height, actual.Height, nameof(Model.Object.Height)); - AssertEqual(expected.Rotation, actual.Rotation, nameof(Model.Object.Rotation)); - AssertEqual(expected.Visible, actual.Visible, nameof(Model.Object.Visible)); - AssertEqual(expected.Template, actual.Template, nameof(Model.Object.Template)); +#pragma warning disable IDE0002 + AssertEqual(expected.ID, actual.ID, nameof(DotTiled.Object.ID)); + AssertEqual(expected.Name, actual.Name, nameof(DotTiled.Object.Name)); + AssertEqual(expected.Type, actual.Type, nameof(DotTiled.Object.Type)); + AssertEqual(expected.X, actual.X, nameof(DotTiled.Object.X)); + AssertEqual(expected.Y, actual.Y, nameof(DotTiled.Object.Y)); + AssertEqual(expected.Width, actual.Width, nameof(DotTiled.Object.Width)); + AssertEqual(expected.Height, actual.Height, nameof(DotTiled.Object.Height)); + AssertEqual(expected.Rotation, actual.Rotation, nameof(DotTiled.Object.Rotation)); + AssertEqual(expected.Visible, actual.Visible, nameof(DotTiled.Object.Visible)); + AssertEqual(expected.Template, actual.Template, nameof(DotTiled.Object.Template)); +#pragma warning restore IDE0002 AssertProperties(expected.Properties, actual.Properties); diff --git a/src/DotTiled.Tests/Assert/AssertProperties.cs b/src/DotTiled.Tests/Assert/AssertProperties.cs index 84af365..843d8d0 100644 --- a/src/DotTiled.Tests/Assert/AssertProperties.cs +++ b/src/DotTiled.Tests/Assert/AssertProperties.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert diff --git a/src/DotTiled.Tests/Assert/AssertTileset.cs b/src/DotTiled.Tests/Assert/AssertTileset.cs index befc79a..4646a85 100644 --- a/src/DotTiled.Tests/Assert/AssertTileset.cs +++ b/src/DotTiled.Tests/Assert/AssertTileset.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public static partial class DotTiledAssert diff --git a/src/DotTiled.Tests/Serialization/MapReaderTests.cs b/src/DotTiled.Tests/Serialization/MapReaderTests.cs index c6e3ec7..885f57e 100644 --- a/src/DotTiled.Tests/Serialization/MapReaderTests.cs +++ b/src/DotTiled.Tests/Serialization/MapReaderTests.cs @@ -1,4 +1,3 @@ -using DotTiled.Model; using DotTiled.Serialization; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData.cs b/src/DotTiled.Tests/Serialization/TestData.cs index 1c0b885..7f68c9e 100644 --- a/src/DotTiled.Tests/Serialization/TestData.cs +++ b/src/DotTiled.Tests/Serialization/TestData.cs @@ -1,5 +1,4 @@ using System.Xml; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/default-map/default-map.cs b/src/DotTiled.Tests/Serialization/TestData/Map/default-map/default-map.cs index da726bf..eff73d9 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/default-map/default-map.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/default-map/default-map.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Tests; public partial class TestData diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-multi/map-external-tileset-multi.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-multi/map-external-tileset-multi.cs index a937685..28d6272 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-multi/map-external-tileset-multi.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-multi/map-external-tileset-multi.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-wangset/map-external-tileset-wangset.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-wangset/map-external-tileset-wangset.cs index 2e4bd61..9aaa7d7 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-wangset/map-external-tileset-wangset.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-external-tileset-wangset/map-external-tileset-wangset.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-common-props/map-with-common-props.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-common-props/map-with-common-props.cs index d5d8c1e..fdedbf8 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-common-props/map-with-common-props.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-common-props/map-with-common-props.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-custom-type-props/map-with-custom-type-props.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-custom-type-props/map-with-custom-type-props.cs index 9a965c2..56759d4 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-custom-type-props/map-with-custom-type-props.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-custom-type-props/map-with-custom-type-props.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-deep-props/map-with-deep-props.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-deep-props/map-with-deep-props.cs index 1b36b4e..90aac6c 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-deep-props/map-with-deep-props.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-deep-props/map-with-deep-props.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-embedded-tileset/map-with-embedded-tileset.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-embedded-tileset/map-with-embedded-tileset.cs index 863dc75..fb3c95f 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-embedded-tileset/map-with-embedded-tileset.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-embedded-tileset/map-with-embedded-tileset.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-external-tileset/map-with-external-tileset.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-external-tileset/map-with-external-tileset.cs index 3682b73..10c4d67 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-external-tileset/map-with-external-tileset.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-external-tileset/map-with-external-tileset.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-flippingflags/map-with-flippingflags.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-flippingflags/map-with-flippingflags.cs index 02a9fc5..4e181c4 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-flippingflags/map-with-flippingflags.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-flippingflags/map-with-flippingflags.cs @@ -1,5 +1,4 @@ using System.Globalization; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-many-layers/map-with-many-layers.cs b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-many-layers/map-with-many-layers.cs index ba0013a..64974bc 100644 --- a/src/DotTiled.Tests/Serialization/TestData/Map/map-with-many-layers/map-with-many-layers.cs +++ b/src/DotTiled.Tests/Serialization/TestData/Map/map-with-many-layers/map-with-many-layers.cs @@ -1,5 +1,4 @@ using System.Numerics; -using DotTiled.Model; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/Tmj/TmjMapReaderTests.cs b/src/DotTiled.Tests/Serialization/Tmj/TmjMapReaderTests.cs index 48cc13f..a896a48 100644 --- a/src/DotTiled.Tests/Serialization/Tmj/TmjMapReaderTests.cs +++ b/src/DotTiled.Tests/Serialization/Tmj/TmjMapReaderTests.cs @@ -1,4 +1,3 @@ -using DotTiled.Model; using DotTiled.Serialization.Tmj; namespace DotTiled.Tests; diff --git a/src/DotTiled.Tests/Serialization/Tmx/TmxMapReaderTests.cs b/src/DotTiled.Tests/Serialization/Tmx/TmxMapReaderTests.cs index 748d4e3..b6e5813 100644 --- a/src/DotTiled.Tests/Serialization/Tmx/TmxMapReaderTests.cs +++ b/src/DotTiled.Tests/Serialization/Tmx/TmxMapReaderTests.cs @@ -1,4 +1,3 @@ -using DotTiled.Model; using DotTiled.Serialization.Tmx; namespace DotTiled.Tests; diff --git a/src/DotTiled/Model/Color.cs b/src/DotTiled/Color.cs similarity index 99% rename from src/DotTiled/Model/Color.cs rename to src/DotTiled/Color.cs index 7de0ab0..367c942 100644 --- a/src/DotTiled/Model/Color.cs +++ b/src/DotTiled/Color.cs @@ -2,7 +2,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a Tiled color. diff --git a/src/DotTiled/Model/Layers/BaseLayer.cs b/src/DotTiled/Layers/BaseLayer.cs similarity index 98% rename from src/DotTiled/Model/Layers/BaseLayer.cs rename to src/DotTiled/Layers/BaseLayer.cs index a16b41a..f00cc01 100644 --- a/src/DotTiled/Model/Layers/BaseLayer.cs +++ b/src/DotTiled/Layers/BaseLayer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Base class for all layer types in a map. diff --git a/src/DotTiled/Model/Layers/Data.cs b/src/DotTiled/Layers/Data.cs similarity index 99% rename from src/DotTiled/Model/Layers/Data.cs rename to src/DotTiled/Layers/Data.cs index d2a9686..6c74edf 100644 --- a/src/DotTiled/Model/Layers/Data.cs +++ b/src/DotTiled/Layers/Data.cs @@ -1,6 +1,6 @@ using System; -namespace DotTiled.Model; +namespace DotTiled; /// /// Specifies the encoding used to encode the tile layer data. diff --git a/src/DotTiled/Model/Layers/Group.cs b/src/DotTiled/Layers/Group.cs similarity index 91% rename from src/DotTiled/Model/Layers/Group.cs rename to src/DotTiled/Layers/Group.cs index f770c63..703e938 100644 --- a/src/DotTiled/Model/Layers/Group.cs +++ b/src/DotTiled/Layers/Group.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a group of layers, to form a hierarchy. diff --git a/src/DotTiled/Model/Layers/ImageLayer.cs b/src/DotTiled/Layers/ImageLayer.cs similarity index 96% rename from src/DotTiled/Model/Layers/ImageLayer.cs rename to src/DotTiled/Layers/ImageLayer.cs index e0bb110..11c157a 100644 --- a/src/DotTiled/Model/Layers/ImageLayer.cs +++ b/src/DotTiled/Layers/ImageLayer.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents an image layer in a map. diff --git a/src/DotTiled/Model/Layers/ObjectLayer.cs b/src/DotTiled/Layers/ObjectLayer.cs similarity index 98% rename from src/DotTiled/Model/Layers/ObjectLayer.cs rename to src/DotTiled/Layers/ObjectLayer.cs index 60acc13..c39b445 100644 --- a/src/DotTiled/Model/Layers/ObjectLayer.cs +++ b/src/DotTiled/Layers/ObjectLayer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents the order in which objects can be drawn. diff --git a/src/DotTiled/Model/Layers/Objects/EllipseObject.cs b/src/DotTiled/Layers/Objects/EllipseObject.cs similarity index 91% rename from src/DotTiled/Model/Layers/Objects/EllipseObject.cs rename to src/DotTiled/Layers/Objects/EllipseObject.cs index 7e777de..75db631 100644 --- a/src/DotTiled/Model/Layers/Objects/EllipseObject.cs +++ b/src/DotTiled/Layers/Objects/EllipseObject.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// An ellipse object in a map. The existing , , , diff --git a/src/DotTiled/Model/Layers/Objects/Object.cs b/src/DotTiled/Layers/Objects/Object.cs similarity index 98% rename from src/DotTiled/Model/Layers/Objects/Object.cs rename to src/DotTiled/Layers/Objects/Object.cs index f2990dc..fe97131 100644 --- a/src/DotTiled/Model/Layers/Objects/Object.cs +++ b/src/DotTiled/Layers/Objects/Object.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Base class for objects in object layers. diff --git a/src/DotTiled/Model/Layers/Objects/PointObject.cs b/src/DotTiled/Layers/Objects/PointObject.cs similarity index 89% rename from src/DotTiled/Model/Layers/Objects/PointObject.cs rename to src/DotTiled/Layers/Objects/PointObject.cs index 44eada8..0c53e1b 100644 --- a/src/DotTiled/Model/Layers/Objects/PointObject.cs +++ b/src/DotTiled/Layers/Objects/PointObject.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// A point object in a map. The existing and properties are used to diff --git a/src/DotTiled/Model/Layers/Objects/PolygonObject.cs b/src/DotTiled/Layers/Objects/PolygonObject.cs similarity index 95% rename from src/DotTiled/Model/Layers/Objects/PolygonObject.cs rename to src/DotTiled/Layers/Objects/PolygonObject.cs index 09805d8..2cf3895 100644 --- a/src/DotTiled/Model/Layers/Objects/PolygonObject.cs +++ b/src/DotTiled/Layers/Objects/PolygonObject.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Numerics; -namespace DotTiled.Model; +namespace DotTiled; /// /// A polygon object in a map. The existing and properties are used as diff --git a/src/DotTiled/Model/Layers/Objects/PolylineObject.cs b/src/DotTiled/Layers/Objects/PolylineObject.cs similarity index 95% rename from src/DotTiled/Model/Layers/Objects/PolylineObject.cs rename to src/DotTiled/Layers/Objects/PolylineObject.cs index d267c07..d755521 100644 --- a/src/DotTiled/Model/Layers/Objects/PolylineObject.cs +++ b/src/DotTiled/Layers/Objects/PolylineObject.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Numerics; -namespace DotTiled.Model; +namespace DotTiled; /// /// A polyline object in a map. The existing and properties are used as diff --git a/src/DotTiled/Model/Layers/Objects/RectangleObject.cs b/src/DotTiled/Layers/Objects/RectangleObject.cs similarity index 91% rename from src/DotTiled/Model/Layers/Objects/RectangleObject.cs rename to src/DotTiled/Layers/Objects/RectangleObject.cs index 99c6cff..8e71ee8 100644 --- a/src/DotTiled/Model/Layers/Objects/RectangleObject.cs +++ b/src/DotTiled/Layers/Objects/RectangleObject.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// A rectangle object in a map. The existing , , , diff --git a/src/DotTiled/Model/Layers/Objects/TextObject.cs b/src/DotTiled/Layers/Objects/TextObject.cs similarity index 98% rename from src/DotTiled/Model/Layers/Objects/TextObject.cs rename to src/DotTiled/Layers/Objects/TextObject.cs index 9c5ed2d..48a095c 100644 --- a/src/DotTiled/Model/Layers/Objects/TextObject.cs +++ b/src/DotTiled/Layers/Objects/TextObject.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace DotTiled.Model; +namespace DotTiled; /// /// The horizontal alignment of text. diff --git a/src/DotTiled/Model/Layers/Objects/TileObject.cs b/src/DotTiled/Layers/Objects/TileObject.cs similarity index 87% rename from src/DotTiled/Model/Layers/Objects/TileObject.cs rename to src/DotTiled/Layers/Objects/TileObject.cs index fe44c50..ab00628 100644 --- a/src/DotTiled/Model/Layers/Objects/TileObject.cs +++ b/src/DotTiled/Layers/Objects/TileObject.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// A tile object in a map. diff --git a/src/DotTiled/Model/Layers/TileLayer.cs b/src/DotTiled/Layers/TileLayer.cs similarity index 96% rename from src/DotTiled/Model/Layers/TileLayer.cs rename to src/DotTiled/Layers/TileLayer.cs index 600f7c0..8207f10 100644 --- a/src/DotTiled/Model/Layers/TileLayer.cs +++ b/src/DotTiled/Layers/TileLayer.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a tile layer in a map. diff --git a/src/DotTiled/Model/Map.cs b/src/DotTiled/Map.cs similarity index 99% rename from src/DotTiled/Model/Map.cs rename to src/DotTiled/Map.cs index 48ed975..0db1205 100644 --- a/src/DotTiled/Model/Map.cs +++ b/src/DotTiled/Map.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Globalization; -namespace DotTiled.Model; +namespace DotTiled; /// /// Map orientation enumeration. The map orientation determines the alignment of the tiles in the map. diff --git a/src/DotTiled/Model/Properties/BoolProperty.cs b/src/DotTiled/Properties/BoolProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/BoolProperty.cs rename to src/DotTiled/Properties/BoolProperty.cs index 315e820..e401d38 100644 --- a/src/DotTiled/Model/Properties/BoolProperty.cs +++ b/src/DotTiled/Properties/BoolProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a boolean property. diff --git a/src/DotTiled/Model/Properties/ClassProperty.cs b/src/DotTiled/Properties/ClassProperty.cs similarity index 95% rename from src/DotTiled/Model/Properties/ClassProperty.cs rename to src/DotTiled/Properties/ClassProperty.cs index 5c9d6a5..933660b 100644 --- a/src/DotTiled/Model/Properties/ClassProperty.cs +++ b/src/DotTiled/Properties/ClassProperty.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a class property. @@ -14,7 +14,7 @@ public class ClassProperty : IHasProperties, IProperty> public required string Name { get; set; } /// - public PropertyType Type => Model.PropertyType.Class; + public PropertyType Type => DotTiled.PropertyType.Class; /// /// The type of the class property. This will be the name of a custom defined diff --git a/src/DotTiled/Model/Properties/ColorProperty.cs b/src/DotTiled/Properties/ColorProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/ColorProperty.cs rename to src/DotTiled/Properties/ColorProperty.cs index 7c4a132..0fff029 100644 --- a/src/DotTiled/Model/Properties/ColorProperty.cs +++ b/src/DotTiled/Properties/ColorProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a color property. diff --git a/src/DotTiled/Model/Properties/CustomTypes/CustomClassDefinition.cs b/src/DotTiled/Properties/CustomTypes/CustomClassDefinition.cs similarity index 98% rename from src/DotTiled/Model/Properties/CustomTypes/CustomClassDefinition.cs rename to src/DotTiled/Properties/CustomTypes/CustomClassDefinition.cs index 313081f..457a17d 100644 --- a/src/DotTiled/Model/Properties/CustomTypes/CustomClassDefinition.cs +++ b/src/DotTiled/Properties/CustomTypes/CustomClassDefinition.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents the types of objects that can use a custom class. diff --git a/src/DotTiled/Model/Properties/CustomTypes/CustomEnumDefinition.cs b/src/DotTiled/Properties/CustomTypes/CustomEnumDefinition.cs similarity index 97% rename from src/DotTiled/Model/Properties/CustomTypes/CustomEnumDefinition.cs rename to src/DotTiled/Properties/CustomTypes/CustomEnumDefinition.cs index 60b7f5b..e155b38 100644 --- a/src/DotTiled/Model/Properties/CustomTypes/CustomEnumDefinition.cs +++ b/src/DotTiled/Properties/CustomTypes/CustomEnumDefinition.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents the storage type of a custom enum. diff --git a/src/DotTiled/Model/Properties/CustomTypes/CustomTypeDefinition.cs b/src/DotTiled/Properties/CustomTypes/CustomTypeDefinition.cs similarity index 92% rename from src/DotTiled/Model/Properties/CustomTypes/CustomTypeDefinition.cs rename to src/DotTiled/Properties/CustomTypes/CustomTypeDefinition.cs index 1e595cc..583bc40 100644 --- a/src/DotTiled/Model/Properties/CustomTypes/CustomTypeDefinition.cs +++ b/src/DotTiled/Properties/CustomTypes/CustomTypeDefinition.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Base class for custom type definitions. diff --git a/src/DotTiled/Model/Properties/EnumProperty.cs b/src/DotTiled/Properties/EnumProperty.cs similarity index 95% rename from src/DotTiled/Model/Properties/EnumProperty.cs rename to src/DotTiled/Properties/EnumProperty.cs index 19e1b1f..a123f9a 100644 --- a/src/DotTiled/Model/Properties/EnumProperty.cs +++ b/src/DotTiled/Properties/EnumProperty.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents an enum property. @@ -12,7 +12,7 @@ public class EnumProperty : IProperty> public required string Name { get; set; } /// - public PropertyType Type => Model.PropertyType.Enum; + public PropertyType Type => DotTiled.PropertyType.Enum; /// /// The type of the class property. This will be the name of a custom defined diff --git a/src/DotTiled/Model/Properties/FileProperty.cs b/src/DotTiled/Properties/FileProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/FileProperty.cs rename to src/DotTiled/Properties/FileProperty.cs index 7c65121..01d4a08 100644 --- a/src/DotTiled/Model/Properties/FileProperty.cs +++ b/src/DotTiled/Properties/FileProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a file property. diff --git a/src/DotTiled/Model/Properties/FloatProperty.cs b/src/DotTiled/Properties/FloatProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/FloatProperty.cs rename to src/DotTiled/Properties/FloatProperty.cs index 57ba928..1652e20 100644 --- a/src/DotTiled/Model/Properties/FloatProperty.cs +++ b/src/DotTiled/Properties/FloatProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a float property. diff --git a/src/DotTiled/Model/Properties/IHasProperties.cs b/src/DotTiled/Properties/IHasProperties.cs similarity index 98% rename from src/DotTiled/Model/Properties/IHasProperties.cs rename to src/DotTiled/Properties/IHasProperties.cs index 1b124a9..21bf0bb 100644 --- a/src/DotTiled/Model/Properties/IHasProperties.cs +++ b/src/DotTiled/Properties/IHasProperties.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -namespace DotTiled.Model; +namespace DotTiled; /// /// Interface for objects that have properties attached to them. diff --git a/src/DotTiled/Model/Properties/IProperty.cs b/src/DotTiled/Properties/IProperty.cs similarity index 97% rename from src/DotTiled/Model/Properties/IProperty.cs rename to src/DotTiled/Properties/IProperty.cs index d2d98e8..de9eebf 100644 --- a/src/DotTiled/Model/Properties/IProperty.cs +++ b/src/DotTiled/Properties/IProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Interface for properties that can be attached to objects, tiles, tilesets, maps etc. diff --git a/src/DotTiled/Model/Properties/IntProperty.cs b/src/DotTiled/Properties/IntProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/IntProperty.cs rename to src/DotTiled/Properties/IntProperty.cs index 27a7afc..2765038 100644 --- a/src/DotTiled/Model/Properties/IntProperty.cs +++ b/src/DotTiled/Properties/IntProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents an integer property. diff --git a/src/DotTiled/Model/Properties/ObjectProperty.cs b/src/DotTiled/Properties/ObjectProperty.cs similarity index 95% rename from src/DotTiled/Model/Properties/ObjectProperty.cs rename to src/DotTiled/Properties/ObjectProperty.cs index de8a1e0..a33e401 100644 --- a/src/DotTiled/Model/Properties/ObjectProperty.cs +++ b/src/DotTiled/Properties/ObjectProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents an object property. diff --git a/src/DotTiled/Model/Properties/PropertyType.cs b/src/DotTiled/Properties/PropertyType.cs similarity index 96% rename from src/DotTiled/Model/Properties/PropertyType.cs rename to src/DotTiled/Properties/PropertyType.cs index 451ca5e..a6a31db 100644 --- a/src/DotTiled/Model/Properties/PropertyType.cs +++ b/src/DotTiled/Properties/PropertyType.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents the type of a property. diff --git a/src/DotTiled/Model/Properties/StringProperty.cs b/src/DotTiled/Properties/StringProperty.cs similarity index 94% rename from src/DotTiled/Model/Properties/StringProperty.cs rename to src/DotTiled/Properties/StringProperty.cs index 0c20b29..c0c8722 100644 --- a/src/DotTiled/Model/Properties/StringProperty.cs +++ b/src/DotTiled/Properties/StringProperty.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a string property. diff --git a/src/DotTiled/Serialization/Helpers.cs b/src/DotTiled/Serialization/Helpers.cs index d47d627..bd839eb 100644 --- a/src/DotTiled/Serialization/Helpers.cs +++ b/src/DotTiled/Serialization/Helpers.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; -using DotTiled.Model; namespace DotTiled.Serialization; diff --git a/src/DotTiled/Serialization/IMapReader.cs b/src/DotTiled/Serialization/IMapReader.cs index d96def5..ec70b91 100644 --- a/src/DotTiled/Serialization/IMapReader.cs +++ b/src/DotTiled/Serialization/IMapReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization; diff --git a/src/DotTiled/Serialization/ITemplateReader.cs b/src/DotTiled/Serialization/ITemplateReader.cs index 9497e26..98901fc 100644 --- a/src/DotTiled/Serialization/ITemplateReader.cs +++ b/src/DotTiled/Serialization/ITemplateReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization; diff --git a/src/DotTiled/Serialization/ITilesetReader.cs b/src/DotTiled/Serialization/ITilesetReader.cs index e798bcf..73fe815 100644 --- a/src/DotTiled/Serialization/ITilesetReader.cs +++ b/src/DotTiled/Serialization/ITilesetReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization; diff --git a/src/DotTiled/Serialization/MapReader.cs b/src/DotTiled/Serialization/MapReader.cs index abd323e..35341f6 100644 --- a/src/DotTiled/Serialization/MapReader.cs +++ b/src/DotTiled/Serialization/MapReader.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Xml; -using DotTiled.Model; using DotTiled.Serialization.Tmj; using DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/TemplateReader.cs b/src/DotTiled/Serialization/TemplateReader.cs index f354c21..2fe92ec 100644 --- a/src/DotTiled/Serialization/TemplateReader.cs +++ b/src/DotTiled/Serialization/TemplateReader.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Xml; -using DotTiled.Model; using DotTiled.Serialization.Tmj; using DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/TilesetReader.cs b/src/DotTiled/Serialization/TilesetReader.cs index 55f0099..b8ba69b 100644 --- a/src/DotTiled/Serialization/TilesetReader.cs +++ b/src/DotTiled/Serialization/TilesetReader.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Xml; -using DotTiled.Model; using DotTiled.Serialization.Tmj; using DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmj/TjTemplateReader.cs b/src/DotTiled/Serialization/Tmj/TjTemplateReader.cs index 6a71eb7..792bb73 100644 --- a/src/DotTiled/Serialization/Tmj/TjTemplateReader.cs +++ b/src/DotTiled/Serialization/Tmj/TjTemplateReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjMapReader.cs b/src/DotTiled/Serialization/Tmj/TmjMapReader.cs index 7ec12e1..8ceb211 100644 --- a/src/DotTiled/Serialization/Tmj/TmjMapReader.cs +++ b/src/DotTiled/Serialization/Tmj/TmjMapReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Data.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Data.cs index 22a35e2..76945ca 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Data.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Data.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Group.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Group.cs index e132d0c..ca08df8 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Group.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Group.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Globalization; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.ImageLayer.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.ImageLayer.cs index 576fa52..f115a52 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.ImageLayer.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.ImageLayer.cs @@ -1,6 +1,5 @@ using System.Globalization; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Layer.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Layer.cs index 9e01d84..33c42fa 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Layer.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Layer.cs @@ -1,5 +1,4 @@ using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Map.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Map.cs index 47abc66..ec45b8d 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Map.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Map.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Globalization; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.ObjectLayer.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.ObjectLayer.cs index cae4790..036e8ff 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.ObjectLayer.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.ObjectLayer.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Globalization; using System.Numerics; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; @@ -34,7 +33,7 @@ public abstract partial class TmjReaderBase _ => throw new JsonException($"Unknown draw order '{s}'.") }, DrawOrder.TopDown); - var objects = element.GetOptionalPropertyCustom>("objects", e => e.GetValueAsList(el => ReadObject(el)), []); + var objects = element.GetOptionalPropertyCustom>("objects", e => e.GetValueAsList(el => ReadObject(el)), []); return new ObjectLayer { @@ -59,7 +58,7 @@ public abstract partial class TmjReaderBase }; } - internal Model.Object ReadObject(JsonElement element) + internal DotTiled.Object ReadObject(JsonElement element) { uint? idDefault = null; string nameDefault = ""; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Properties.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Properties.cs index c5b6a7d..c8683b2 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Properties.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Properties.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Template.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Template.cs index 45031db..88bcf09 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Template.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Template.cs @@ -1,5 +1,4 @@ using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; @@ -9,7 +8,7 @@ public abstract partial class TmjReaderBase { var type = element.GetRequiredProperty("type"); var tileset = element.GetOptionalPropertyCustom("tileset", ReadTileset, null); - var @object = element.GetRequiredPropertyCustom("object", ReadObject); + var @object = element.GetRequiredPropertyCustom("object", ReadObject); return new Template { diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.TileLayer.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.TileLayer.cs index ecc74d8..e3ccc9a 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.TileLayer.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.TileLayer.cs @@ -1,6 +1,5 @@ using System.Globalization; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Tileset.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Tileset.cs index 5fef5f3..c19e3f6 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.Tileset.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.Tileset.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Globalization; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TmjReaderBase.cs b/src/DotTiled/Serialization/Tmj/TmjReaderBase.cs index 4ae338f..f36ca88 100644 --- a/src/DotTiled/Serialization/Tmj/TmjReaderBase.cs +++ b/src/DotTiled/Serialization/Tmj/TmjReaderBase.cs @@ -1,6 +1,5 @@ using System; using System.Text.Json; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmj/TsjTilesetReader.cs b/src/DotTiled/Serialization/Tmj/TsjTilesetReader.cs index 8c918b5..5816c8a 100644 --- a/src/DotTiled/Serialization/Tmj/TsjTilesetReader.cs +++ b/src/DotTiled/Serialization/Tmj/TsjTilesetReader.cs @@ -1,5 +1,4 @@ using System; -using DotTiled.Model; namespace DotTiled.Serialization.Tmj; diff --git a/src/DotTiled/Serialization/Tmx/TmxMapReader.cs b/src/DotTiled/Serialization/Tmx/TmxMapReader.cs index e90caa1..6029481 100644 --- a/src/DotTiled/Serialization/Tmx/TmxMapReader.cs +++ b/src/DotTiled/Serialization/Tmx/TmxMapReader.cs @@ -1,6 +1,5 @@ using System; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Chunk.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Chunk.cs index 73c8052..4ab5b11 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Chunk.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Chunk.cs @@ -1,5 +1,3 @@ -using DotTiled.Model; - namespace DotTiled.Serialization.Tmx; public abstract partial class TmxReaderBase diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Data.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Data.cs index 254c1d3..fb29250 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Data.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Data.cs @@ -4,7 +4,6 @@ using System.IO; using System.IO.Compression; using System.Linq; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Map.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Map.cs index 89f0c9b..11d6fc1 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Map.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Map.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.ObjectLayer.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.ObjectLayer.cs index a680544..0233639 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.ObjectLayer.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.ObjectLayer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Numerics; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; @@ -36,7 +35,7 @@ public abstract partial class TmxReaderBase // Elements List? properties = null; - List objects = []; + List objects = []; _reader.ProcessChildren("objectgroup", (r, elementName) => elementName switch { @@ -68,11 +67,11 @@ public abstract partial class TmxReaderBase }; } - internal Model.Object ReadObject() + internal DotTiled.Object ReadObject() { // Attributes var template = _reader.GetOptionalAttribute("template"); - Model.Object? obj = null; + DotTiled.Object? obj = null; if (template is not null) obj = _externalTemplateResolver(template).Object; @@ -100,7 +99,7 @@ public abstract partial class TmxReaderBase var visible = _reader.GetOptionalAttributeParseable("visible") ?? visibleDefault; // Elements - Model.Object? foundObject = null; + DotTiled.Object? foundObject = null; int propertiesCounter = 0; List? properties = propertiesDefault; @@ -138,7 +137,7 @@ public abstract partial class TmxReaderBase return OverrideObject(obj, foundObject); } - internal static Model.Object OverrideObject(Model.Object? obj, Model.Object foundObject) + internal static DotTiled.Object OverrideObject(DotTiled.Object? obj, DotTiled.Object foundObject) { if (obj is null) return foundObject; @@ -305,7 +304,7 @@ public abstract partial class TmxReaderBase Tileset? tileset = null; // Should contain exactly one of - Model.Object? obj = null; + DotTiled.Object? obj = null; _reader.ProcessChildren("template", (r, elementName) => elementName switch { diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Properties.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Properties.cs index 863e125..de12d57 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Properties.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Properties.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.TileLayer.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.TileLayer.cs index f69a739..c345917 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.TileLayer.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.TileLayer.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Tileset.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Tileset.cs index 72e66e9..bffe0bd 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.Tileset.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.Tileset.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TmxReaderBase.cs b/src/DotTiled/Serialization/Tmx/TmxReaderBase.cs index 5851d76..e30af82 100644 --- a/src/DotTiled/Serialization/Tmx/TmxReaderBase.cs +++ b/src/DotTiled/Serialization/Tmx/TmxReaderBase.cs @@ -1,6 +1,5 @@ using System; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TsxTilesetReader.cs b/src/DotTiled/Serialization/Tmx/TsxTilesetReader.cs index 176872b..3b442da 100644 --- a/src/DotTiled/Serialization/Tmx/TsxTilesetReader.cs +++ b/src/DotTiled/Serialization/Tmx/TsxTilesetReader.cs @@ -1,6 +1,5 @@ using System; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Serialization/Tmx/TxTemplateReader.cs b/src/DotTiled/Serialization/Tmx/TxTemplateReader.cs index 1ff8445..72da9dc 100644 --- a/src/DotTiled/Serialization/Tmx/TxTemplateReader.cs +++ b/src/DotTiled/Serialization/Tmx/TxTemplateReader.cs @@ -1,6 +1,5 @@ using System; using System.Xml; -using DotTiled.Model; namespace DotTiled.Serialization.Tmx; diff --git a/src/DotTiled/Model/Template.cs b/src/DotTiled/Template.cs similarity index 80% rename from src/DotTiled/Model/Template.cs rename to src/DotTiled/Template.cs index d8cee95..56052de 100644 --- a/src/DotTiled/Model/Template.cs +++ b/src/DotTiled/Template.cs @@ -1,7 +1,7 @@ -namespace DotTiled.Model; +namespace DotTiled; /// -/// Represents a Tiled template. A template is a reusable object that can be placed in an inside the Tiled editor. +/// Represents a Tiled template. A template is a reusable object that can be placed in an inside the Tiled editor. /// public class Template { diff --git a/src/DotTiled/Model/Tilesets/Frame.cs b/src/DotTiled/Tilesets/Frame.cs similarity index 93% rename from src/DotTiled/Model/Tilesets/Frame.cs rename to src/DotTiled/Tilesets/Frame.cs index 7e48aa0..ff37133 100644 --- a/src/DotTiled/Model/Tilesets/Frame.cs +++ b/src/DotTiled/Tilesets/Frame.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// A single frame of an animated tile. diff --git a/src/DotTiled/Model/Tilesets/Grid.cs b/src/DotTiled/Tilesets/Grid.cs similarity index 96% rename from src/DotTiled/Model/Tilesets/Grid.cs rename to src/DotTiled/Tilesets/Grid.cs index e8acfac..c063dd1 100644 --- a/src/DotTiled/Model/Tilesets/Grid.cs +++ b/src/DotTiled/Tilesets/Grid.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Orientation of the grid for the tiles in this tileset. diff --git a/src/DotTiled/Model/Tilesets/Image.cs b/src/DotTiled/Tilesets/Image.cs similarity index 97% rename from src/DotTiled/Model/Tilesets/Image.cs rename to src/DotTiled/Tilesets/Image.cs index 418d5f4..cee67ff 100644 --- a/src/DotTiled/Model/Tilesets/Image.cs +++ b/src/DotTiled/Tilesets/Image.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// The format of an image. diff --git a/src/DotTiled/Model/Tilesets/Tile.cs b/src/DotTiled/Tilesets/Tile.cs similarity index 98% rename from src/DotTiled/Model/Tilesets/Tile.cs rename to src/DotTiled/Tilesets/Tile.cs index 9919cfd..835ecac 100644 --- a/src/DotTiled/Model/Tilesets/Tile.cs +++ b/src/DotTiled/Tilesets/Tile.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a single tile in a tileset, when using a collection of images to represent the tileset. diff --git a/src/DotTiled/Model/Tilesets/TileOffset.cs b/src/DotTiled/Tilesets/TileOffset.cs similarity index 93% rename from src/DotTiled/Model/Tilesets/TileOffset.cs rename to src/DotTiled/Tilesets/TileOffset.cs index 6030f39..b446036 100644 --- a/src/DotTiled/Model/Tilesets/TileOffset.cs +++ b/src/DotTiled/Tilesets/TileOffset.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Is used to specify an offset in pixels in tilesets, to be applied when drawing a tile from the related tileset. diff --git a/src/DotTiled/Model/Tilesets/Tileset.cs b/src/DotTiled/Tilesets/Tileset.cs similarity index 99% rename from src/DotTiled/Model/Tilesets/Tileset.cs rename to src/DotTiled/Tilesets/Tileset.cs index 47f2021..0c2863f 100644 --- a/src/DotTiled/Model/Tilesets/Tileset.cs +++ b/src/DotTiled/Tilesets/Tileset.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// The alignment of tile objects. diff --git a/src/DotTiled/Model/Tilesets/Transformations.cs b/src/DotTiled/Tilesets/Transformations.cs similarity index 96% rename from src/DotTiled/Model/Tilesets/Transformations.cs rename to src/DotTiled/Tilesets/Transformations.cs index b6cf6bf..8ed7c36 100644 --- a/src/DotTiled/Model/Tilesets/Transformations.cs +++ b/src/DotTiled/Tilesets/Transformations.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents which transformations can be applied to a tile in a tileset. diff --git a/src/DotTiled/Model/Tilesets/WangColor.cs b/src/DotTiled/Tilesets/WangColor.cs similarity index 97% rename from src/DotTiled/Model/Tilesets/WangColor.cs rename to src/DotTiled/Tilesets/WangColor.cs index f5d1186..b5ef482 100644 --- a/src/DotTiled/Model/Tilesets/WangColor.cs +++ b/src/DotTiled/Tilesets/WangColor.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a Wang color in a Wang set. diff --git a/src/DotTiled/Model/Tilesets/WangTile.cs b/src/DotTiled/Tilesets/WangTile.cs similarity index 92% rename from src/DotTiled/Model/Tilesets/WangTile.cs rename to src/DotTiled/Tilesets/WangTile.cs index 2347b91..0432cdd 100644 --- a/src/DotTiled/Model/Tilesets/WangTile.cs +++ b/src/DotTiled/Tilesets/WangTile.cs @@ -1,4 +1,4 @@ -namespace DotTiled.Model; +namespace DotTiled; /// /// Represents a Wang tile in a Wang set. diff --git a/src/DotTiled/Model/Tilesets/Wangset.cs b/src/DotTiled/Tilesets/Wangset.cs similarity index 97% rename from src/DotTiled/Model/Tilesets/Wangset.cs rename to src/DotTiled/Tilesets/Wangset.cs index 66952e8..16ceb56 100644 --- a/src/DotTiled/Model/Tilesets/Wangset.cs +++ b/src/DotTiled/Tilesets/Wangset.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace DotTiled.Model; +namespace DotTiled; /// /// Defines a list of colors and any number of Wang tiles using these colors.