Adding first trait (php trait..) - TMeta.
TMeta is an attempt to migrate the common properties tag, name & description, and the related logic to deal with these properties, out from various source files and into a single trait.
TMeta is also, for now at least, taking on responsibility for helping classes maintain a single static repository for holding all their instances, accessible by tag.
Adding new Item class, to handle (or at least provide a base class for handling) items - weapons, armour, potions, MacGuffins etc.
Note that it is the first, seemingly working, test of TMeta & its functionality
Added a (very sparse) prototype Item file insignia.item to new data/items/ directory
Mostly necessary for testing systems that work/will work on items
Merc require's Item now
Rewrote the JSON format of the Merc test file - test/data/merc_01.json
Inventory is still an array, but now of objects with the rough form:
item     => item tag  -as other similar classes
quantity => int       -possibly optional? some items may be 'unique' or w/e
data     => object    -arbitrary state data held for the item, though this may prove too crude
Added the more human-readable blueprint of the test case Merc file
Wrote up code to form a sort of 'abstraction layer' between methods expecting a JSON string, and data that may be a JSON string -or- a tag (which will correspond to a JSON file) in a new static method of TMeta - unpack()
unpack() takes a string which could be a tag or JSON string (or in future, a path, or maybe even further 'formats'..) and returns a JSON string (if this is at all possible)
Added unpack() 'abstraction' to the top of TMeta::add() method
Added logic to Merc's constructor to load inventory/Item data from JSON
Added (hacky) access to a basic printout of Merc inventory via Inventory property rendering a list of tags as a string
Added a line printing out Merc->Inventory to the test/merc.php test script
Adding (mostly) empty placeholder Item files to data/items/ to fill the requirements of the test Merc 'character sheet'
Cleaned up TMeta's get() method, now there is TMeta::unpack()
Added new TBuffs trait for shared Buff functionality.
Notably a fair number of classes appear to follow a very similar model, managing their own register of Buffs to be applied to Merc/etc.
With this new trait the system will be more dynamic - instead of a Merc holding onto a Buff list, the list will be generated on-demand from all the buff-granting traits/skills/items etc. (perhaps combined with -some- help by Merc, for short term Buffs - injuries, spell/ability effects etc.)
Added first draft of an addBuffs() method to TBuffs
Abstracting this ugly logic out of other classes, combined with tidying up ABuff, is very desirable
Converted Traits over to using TMeta
Removed a wayward commented out line from Traits.php
(Partially) migrated ABuff to TMeta
Still relies on local get() & add() methods, for now, due to the awkward parentTag & parentType properties. These aren't really used, and will likely be refactored out soon anyway, allowing the migration to finish.
Tidied up StaticBuff & PercentBuff to be more flexible and future-proof - like their scaling counterparts.
Added local members to Actor for the combat stats