kypvalanx / Foundry-VTT-StarWars-SagaEdition

25 stars 7 forks source link

Data Model enhancement pt1b - npc actors #464

Open TalonKetupa opened 4 months ago

TalonKetupa commented 4 months ago

This is to track the beginnings of migrating data structures to foundry data models. Foundry data models provide the benefits of

validation on initialization and update, and on-the-fly data migration and coercion. It also allows functionality to be delegated out to these models, reducing the burden on the system's Document implementation to solely house such logic https://foundryvtt.com/article/system-data-models/

My current thought for this is to create the base data framework based on the existing way that data is being stored. Also, to transform the data helper/retrieval functions to be separated by the respective document types that use them.

Pt1 will be looking over actors. But I will tackle this one at a time in case there is any feedback in the process. 1a. character actors first - #446 1b. npc actors 1c. vehicle actors - #465 then Pt2 Actor Sheet adjustments Pt3 Data migration and test cases

Create draft of npc data model

This npc data model draft will be temporarily housing transformed versions of helper functions to facilitate a smooth transition when the time comes and also to allow for the data migration functions to be defined at a later time through comparison.

kypvalanx commented 4 months ago

https://github.com/kypvalanx/Foundry-VTT-StarWars-SagaEdition/issues/465#issuecomment-2078396394