Rushwind13 / JMoria

My from-scratch implementation of a Roguelike game that will be an homage to IMoria
4 stars 4 forks source link

Files are read into Linked Lists "backwards" #53

Closed Rushwind13 closed 2 weeks ago

Rushwind13 commented 1 month ago

Given I have a Resource File And the first item in the file is a Longsword When I read the whole file Then the first item in the linked list is a Longsword

As of this writing, files are read in "backwards", with the last item in the file being index # 0 in the linked list.

Note: this is probably in linked list insertion, write tests and make it go!

Rushwind13 commented 1 month ago

To be fair, the linked lists are "indexed" based on a MON_IDX / ITEM_IDX field, so by e.g. retrieving the ITEM_IDX_SHIELD-th item in the list, you'll get back the correct item, no matter if it's 1st or 100th.

Rushwind13 commented 2 weeks ago

https://github.com/Rushwind13/JMoria/pull/84 makes it easier to find the correct index (if needed)