-
fstream
Hi, havn't posted in a while lads and lasses, been designing my text engine.
Anyways....... I was thinking that instead of hardcoding all the text in the program, I could write the storyline, directions etc.... in text file(s). It would save alot of my time coding. But this is where i'm sort of in a debate with myself, should I write a class/function to load/close the text file when needed\not needed or just load it whenever I need it? If it's the first option then can you kind people advise me on how to do it, i'm not that good with fstream.
Thanks
Beene
-
Use a database library like sqlite (I've not used it, though I do advertise it a bit here for some reason). That way you can easily load whatever segment you want easily and quickly. All you need to do is add the storylines to the database and make your program load the right ones.
-
An engine (at least in the spirit of a game engine) is not particularly useful if its resources are compiled into the code.
So yes, definitely look into fstream or some higher library.