Closed madpew closed 10 years ago
Some issues:
And some comments:
ad 1&2: Oh wow, thanks for pointing that out. I really didn't think about that. Should I try to get the roomstates into the Gamestate or scrap the idea alltogether? ad 3: Indeed, it's totally stupid to recreate the array there.
ad Comment 1&2: I started splitting the code by topic, with the intention to make it easier to find where new code should belongs. Wanna change something about games > Game, Persistence Data > Gamestate. "BuiltIn" was just chosen to represent that those functions are "built in" the engine for the script to use. Could also be "Command" or something similar. I'd like to have those Scriptcommands seperated because they shouldn't be altered (would break existing games).
I'll try to modify the PR accordingly.
Added: Gamestate.load/save now also load/save the roomstates. Fixed: No more resizing the inventory on loadstate Added: another way to load gamestates. (intended for use with Sequels).
When using Gamestate.load with isSequel set to true, it ignores the gamename-check and only loads the inventory, score and position. For this to work correctly, the sequelgame needs to be careful with the items.
feedback and suggestions for renaming the BuiltIn-class welcome
I think the Gamestate idea should be scrapped, because it honestly makes more sense from an OOP perspective to have the roomstate in the Room class. You could just move all of the Gamestate functionality into the Game class.
Personally, I'd name the BuiltIn class to "UtopiaScriptHandler" or something similar.
Ok I'll merge Gamestate into Game and rename the Builtins
Not a comment on your modifications, but after having the concept of UtopiaScript bouncing around in my head for the longest time, it's really nice to finally see its name actually displayed in the code. I'm really starting to enjoy your splitting the UtopianEngine class into chunks.
I moved some parts of UtopianEngine out of the (huge) main-file for better code maintainability. I decided to create Game (for all data related to the current game), Gamestate (for all data related to the progress/playerstate) and BuiltIn (to store all script-functions).
Implemented loadstate/savestate-commands and added it to Egerfortia. ( maybe solves issue #43 ? )
Added a Settings-class that reads/writes ue.ini at startup. Currently the only settings is linelength. ( see issue #52 )
Feedback welcome.