FoundryDevelopmentConsortium / Knowledge-Recalled-PF2e-FVTT

Creative Commons Zero v1.0 Universal
0 stars 3 forks source link

Refactored the ActorModel Please read notes for current TODOs. #6

Closed christianhturner closed 1 year ago

christianhturner commented 1 year ago

this will now successfully create objects from the actors which are currently in the world encounters. I've refactored the constructor for properties and began to work on the getMethods, but they currently do not work. We need to think through the get method because the way it currently stands these methods will continue to push existing items into the array. We need to either check the entries prior to pushing to check if it already exist, or have a separate method for updating and only use the get method when creating the object. This is likely the better route.

We will also need to update our entries whenever the system detects a change occurring so we need to determine whether we do this on this object or the internal object. Likely a mix of both if we want this to serve as the API but also be able to take any changes the API detects.

The other issue that I have found is that when I make changes to the actor on the board, those changes are not reflective on the actor itself. Which is to be expected, but we need to find a way to rectify this. Targeting the Actor has the benefit of not creating an entry every time a creature of the same type comes on the board. We want those creatures to share the same entity object within our system. Should someone take a creature and make a 'boss' for instance, and change the name and change values this will still use the original ActorID despite it being a different 'actor' in terms of properties and values.

The direct way to resolve that would be to track the tokens and actors on the board, but they we need a way to ensure that we aren't recording duplicates. We will need to work through how to process this.

lastly we need to work through the getData Method and determine the best way to implement this.