HUGE CHANGES
Ok so this is a vast change on many layers, the highlights are:
- This is now more of a MonoRepo for things which always needed releasing together
- There is now a formal split between
Template
,TemplateData
,TemplateInstance
- The editor app works and can be used for basic template creation/editing/storage and is bundled with release
- Demo has been updated with newer functionality and is on this repo now https://openrpg.github.io/OpenRpg
The MonoRepo stuff wont effect most of you, it just means the source code is all in this one place now, but the refactors of Template
stuff will effect you.
Template Change Stuff
The general idea behind this is to simplify the split of Static and Runtime data, as historically you had an Item
which contained an ItemTemplate
and lots of other instance data, so when you wanted to save data you would need to do a basic ETL process to strip Template
data out and bung data into a dedicated data object, which was more code and it needed maintaining etc.
When taking a step back an Item
needs to contain information about the Template
and the TemplateData
but rather than it containing the data directly on itself its instead stored in a separate internal Data
field. This brings in a new notion of TemplateInstance
which combines both the static and runtime data in one place.
Before you would go Item.Variables.Amount()
now you would go Item.Data.Variables.Amount()
but this means that when you want to persist data you only need to take the ItemData
object and directly serialize it, same for all high level Template
types, it has become so much easier to just save all the data and then rehydrate it as needed.
This also brings in an ITemplateAccessor
which is like a VERY SPECIFIC IRepository
that just lets you get Template
types and rehydrate full templates from the data.
Editor
If you look below in the release you should see the editor-<version>.zip
available to download, this has been transformed and updated into a standalone editor, and while its early days and a bit bare bones, it will allow you to at least create/manage templates within a basic project structure.
Now that its part of the core repo it is easier to keep in line with changes and update more as time goes on.
Nothing else to say really
Let us know if you have any issues, and if you are confused by any changes go look at the updated demos/source to see new syntax/usages.