Commit Graph

1300 Commits

Author SHA1 Message Date
554553888c Created PropertiesGenerator, GemUtils and tests
GemUtils may be rolled into PropertiesGenerator
PropertiesGenerator may belong with item generation
More validation for behavior on a larger variety of items required
Disabled an assertion in StatListLabeler which prevented creating labels for Attributes#list()
Above assertion only necessary to enforce label creation only works for Attribute collections
2020-09-05 02:20:03 -07:00
f1246f5aea Added getter for ItemStatCost entry using String stat code 2020-09-05 02:15:10 -07:00
82d08989d1 Added type-safe version of Item#getBase 2020-09-04 21:54:40 -07:00
e0f977f8a0 Replaced comment to reference Item#data repurpose 2020-09-04 21:54:13 -07:00
0548514a9e Added improved support for injection during tests 2020-09-04 21:48:26 -07:00
b7dcf0f4fe Modified logging parameters to show only StatListLabeler trace 2020-09-04 20:44:31 -07:00
030564a5a6 Created StatListLabeler and tests
Encoded stats may require StatGetter#asString instead of value
Changed visibility of StatList#MAX_LISTS and StatList#MAX_STATS to package-private
2020-09-04 20:42:23 -07:00
7c54483e12 Created AttributesUpdater and tests to fold attributes into each other 2020-09-04 20:40:43 -07:00
3b34642c0d Created StatFormatter#formatEncoded to format encoded stats 2020-09-04 20:39:14 -07:00
2bd5f217a4 Changed return type for StatFormatter methods to String from CharSequence 2020-09-04 20:38:39 -07:00
2fd51347bf Fixed issues with StatList#add and StatList#ensureCapacity
Add functions now validate they are adding to same stat, else they put a new one
Moved arraycopy copies into static function
StatList#ensureCapacity will correctly copy arrays
Moved any offsets modification operations into StatList#ensureCapacity
2020-09-04 18:29:48 -07:00
db04f49fba Added support for StatListGetter#get(int) index 2020-09-04 15:54:40 -07:00
a839560e6a Implemented StatListBuilder#toString() 2020-09-04 15:53:01 -07:00
b45f770478 Changed StatList.IndexIterator to support pushback(int)
StatList.IndexIterator can now pushback n indexes (up to list start index)
2020-09-04 15:52:41 -07:00
79a9409a75 Fixed and issue where StatList#ensureCapacity(int,int) was only shifting next list
Added int index to StatList#ensureCapacity so that it shifts after index
Added additional validation within StatList#ensureCapacity
Added assertion that clearList does not result in a negative size
StatList#copy(int,StatList,int) now copies #maxLists as well
Added additional logging for StatList#copy
2020-09-04 15:51:49 -07:00
e892970ef8 Added constants and getters for encoded and grouped stats 2020-09-04 15:47:47 -07:00
ecd6946ffe Fixed StatList#add where stat did not exist 2020-09-03 21:20:53 -07:00
61ba1248e1 Fixed bug where adding stat that didn't exist resulted in an IOOBE 2020-09-03 20:52:14 -07:00
04b9ed785c Created StatFormatter and tests, testing as-needed 2020-09-03 20:43:28 -07:00
8b06f92f54 Added getter and checker for stat ids 2020-09-03 18:53:13 -07:00
fa7e066ee1 Created StatList#isEmpty() to check if there are any stats in any list 2020-09-03 18:37:30 -07:00
948f1a189c Added static getter Stat#index(String) to get stat id from String name 2020-09-03 18:34:34 -07:00
a3b3840b20 Added support for iterating over StatList lists 2020-09-03 18:33:55 -07:00
b17f528611 Changed signatures for StatListBuilder#add(StatGetter) and #addAll(StatListGetter)
Changed signatures for StatListBuilder#add(StatGetter) and #addAll(StatListGetter) to match sibling methods
Changed StatList#addAll(int,StatList,int) to return the last index added
Above change is so that StatListBuilder index remains valid and calling #addAll does not result in undefined behavior
2020-09-03 18:02:05 -07:00
bf5b0677cc Moved modification functions #add(StatGetter) and #addAll(StatListGetter)
Moved modification functions #add(StatGetter) and #addAll(StatListGetter) from StatListGetter to StatListBuilder
StatListGetter should contain read-only operations
2020-09-03 17:57:20 -07:00
4c96af70d3 Changed Attriutes#remaining() to return StatListGetter instead of StatList
Changed Attriutes#remaining() to return StatListGetter instead of StatList
Unsure if this will change, but all calls require #first()
Attribute returns are all asserted to be StatLists of numLists = 1
Creation of StatList delegated, or in the case of AggregateAttributes, lazily initialized
2020-09-03 17:54:24 -07:00
bd278e3c82 Changed Attriutes#base() to return StatListGetter instead of StatList
Changed Attriutes#base() to return StatListGetter instead of StatList
Unsure if this will change, but all calls require #first()
Attribute returns are all asserted to be StatLists of numLists = 1
StatList is by default delegated, or in the case of AggregatedAttributes, lazily initialized
Added support for retrieving StatListGetter parent StatList
Added support for creating a StatListBuilder from StatListGetter
Added support for clearing a StatList list from StatListGetter
2020-09-03 17:52:36 -07:00
5d9420a659 Moved aggregate list creation to Attributes#aggregate() to lazily init 2020-09-03 17:47:57 -07:00
e26b22c1ba Changed Attriutes#aggregate() to return StatListGetter instead of StatList
Changed Attriutes#aggregate() to return StatListGetter instead of StatList
Unsure if this will change, but all calls require #first()
Attribute returns are all asserted to be StatLists of numLists = 1
2020-09-03 17:32:58 -07:00
eddd0e9b0a Created StatList#add(int,StatGetter) to add stats 2020-09-03 17:14:11 -07:00
cac5236225 Added support for using StatGetter on StatListGetter operations
Added support for using StatGetter on StatListGetter operations
Created StatList#contains(int,short,int) to check a specific stat with param
2020-09-03 14:26:35 -07:00
07ad2d4af2 Created package-private StatList#forceClear() to allow clearing frozen list
StatList#clear() did not allow clearing when frozen for external APIs
Attributes re-uses stat lists, and requires the ability to force clear
Renamed Attributes#resetToBase() to #reset() (functionality is documented)
Attributes#reset() no longer clears Attributes#list
2020-09-03 14:08:17 -07:00
2b07fcc3d0 Added logged warning when StatListGetter#get(short) returns null 2020-09-03 03:12:04 -07:00
61eca6070f Changed return type of Attributes#resetToBase() to support chaining 2020-09-03 03:11:22 -07:00
534df98623 Renamed StatListBuilder#list() to #build() 2020-09-03 02:16:38 -07:00
f929a99ab4 Renamed StatListBuilder#build() to #index() 2020-09-03 02:16:06 -07:00
5313629f27 Committing item writer test cases 2020-09-02 20:34:15 -07:00
2193040a6d Added println to help differentiate between hex dumps 2020-09-02 20:33:43 -07:00
f0ea202ff3 Implemented character save writing and tests 2020-09-02 20:31:21 -07:00
3e5a49943c Additional tests to validate StatListWriter
Validation that a reasonable number of item stat lists write correctly
2020-09-02 20:13:51 -07:00
e8601ec692 Fixed case where item prop lists was empty (stat termination required) 2020-09-02 20:11:09 -07:00
6b9a97949a Changed access to static package from public local 2020-09-02 20:10:37 -07:00
d3cbca6b6f Added boolean parameter to read/write StatList functions
entry.Saved was not appropriate for determining this feature
Implemented prop list flags into StatListWriterTest tests
Added additional logging to help with organizing encoded stats
2020-09-02 19:47:05 -07:00
57c12bd781 Renamed StatListFlags constants and added getter for gem property list names 2020-09-02 19:29:49 -07:00
ddd7b7d07f Implemented MDC property for propList name 2020-09-02 18:57:55 -07:00
da9acd5977 Created StatListFlags to store stat list flags (copied from Item) 2020-09-02 18:55:35 -07:00
ca829a4025 Created StatListWriter and tests
Additional testing required, but workable code
2020-09-02 18:20:30 -07:00
e6f4a8b222 Changed to skip bits only (bytes included) 2020-09-02 18:19:22 -07:00
4ed61438db Added bit mask for Long#Size
Reverted previous change
writeRaw performs logical-and with bit mask to ensure cache correctness
2020-09-02 18:18:26 -07:00
63e3cc0e8b Fixed issue where flush would write more bits than cached 2020-09-02 18:03:15 -07:00