1 January 2025 - The Conservatory Analysis Tools
<<< Previous Post
Next Post >>>
Before I start this blog post, obligatory messages: Happy new year! I can't believe it's already 2007.
Anyway... It's another blog post about the analyzer - but rest assured, this time, I have good news.
As a brief recap, I wanted to make a Roslyn Analyzer + Code Fix combo for my future modders. Roslyn is the system that compiles C# for .NET, and analyzers are tools that operate within this space to create compiler warnings and errors.
Using this, I have created many special, custom diagnostics that show up in modded code (or even my code!) for The Conservatory.
Here's some little examples of the helpful redirects the tool gives you:
And as a matter of fact, there's a lot of little helpful goodies in here. You may have noticed each warning is a clickable link. That's right - even the diagnostics are documented!
You may need to press on the following images to zoom in.


You can see there's a lot of assorted diagnostics that make sure your code stays functional and mistakes are caught before you get into your testing phase. Every page for every diagnostic has as much detail as it needs to make it abundantly clear exactly why a warning/error is raised, and how to fix it, including multiple ways to fix it if the fix is not straightforward.
To crank this up to 11, though, I will add that the code keywords in that second image for the game types AbstractLivingEntity
and AbstractSpeciesEntity
will be clickable links in the future, leading to the game's online documentation. So if you were going to ask "What's the difference", that question is answered too via the game's documentation.1
As you can see, my give-a-shit for my modding community is not broken, and my field of fucks is most certainly not barren.
-
AbstractSpeciesEntity
is a convenience layer that shunts in a call toEntityValidation.AssertSpeciesIs(...)
into the constructor. This way, you can't construct anAbstractGaianEntity
(which extends this type) usingSpecies.Novan
, for example. This will raise an exception.
This is an entirely optional convenience layer however, and it's more than valid to skip it and just call the assertion yourself. This is why it's not a good idea to limit byAbstractSpeciesEntity
- an entity may not even be using it in the first place! ↩