Modified core types to be marked via DataContract only
Fixed bug with Color where wrong field was serializable (fixes #36)
Ensured types emit the proper, minimal data (fixes #27)
Added the "expressive" types concept from SadConsole.
These types are serializable via both DataContract serializers (including JSON.NET) and XmlSerializers
Types are implicitly castable to and from their "expressive" counterparts
In the case of the "enum wrapper" types such as AdjacencyRule, Direction, etc, there is no serializable version
Instead, the underlying Types enum value is used.
Removed functions to convert a Type to its corresponding instance in these classes, and replaced them with implicit conversions
Added unit tests to verify JSON.NET (data contract) serialization and binary (XmlSerializer) serialization.
Added unit tests to verify the minimal/expected fields are serialized in JSON for each type
Various code cleanup
.editorconfig modifications to format code in the expected way
Some code reformatting
There is still a good bit of code formatting that needs to be done after the editorconfig edits, however it should probably be done in a separate ticket to avoid changing every file in the solution on this one. Additionally, I did not update the project to .NET Standard 2.1 nor do the multi-targeting to .NET Core 3 yet; I figured that would be a prime candidate for a future pull request as well, as it opens the door for a bunch more code cleanup using C# 8 features (see #37).
DataContract
onlyColor
where wrong field was serializable (fixes #36)AdjacencyRule
,Direction
, etc, there is no serializable versionTypes
enum value is used.Type
to its corresponding instance in these classes, and replaced them with implicit conversions.editorconfig
modifications to format code in the expected wayThere is still a good bit of code formatting that needs to be done after the editorconfig edits, however it should probably be done in a separate ticket to avoid changing every file in the solution on this one. Additionally, I did not update the project to .NET Standard 2.1 nor do the multi-targeting to .NET Core 3 yet; I figured that would be a prime candidate for a future pull request as well, as it opens the door for a bunch more code cleanup using C# 8 features (see #37).