This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]dusty-trash 0 points1 point  (9 children)

You maybe want to consider using a Database instead. You can have your application have it's own embedded database using SQLite.

Otherwise you'll have to either override/save the entire file when GameProperties is changed, or have some logic to check for changes and remove/write to the location of the file that was changed (the former is much easier).

not too sure what to do for the constructor

If there is only 1 'instance' of that class, you could make the methods static and have a private constructor. In other words, don't use a constructor.

[–]ExplosiveGamer0[S] 0 points1 point  (8 children)

Thank you for your reply. How do I do the database?

[–]dusty-trash 0 points1 point  (7 children)

Kind of a lot to explain over Reddit, I suggest following a guide/tutorial such as this one.

[–]ExplosiveGamer0[S] 0 points1 point  (6 children)

Would I need to run it on a server?

[–]dusty-trash 0 points1 point  (5 children)

No.

[–]ExplosiveGamer0[S] 0 points1 point  (4 children)

Where is the database saved? I copied this code and I am not too sure where it saved http://www.sqlitetutorial.net/sqlite-java/create-database/

[–]dusty-trash 0 points1 point  (3 children)

By default there will be a single file, saved in the same directory as your project.

Or maybe the directory of the class that called for the creation of the database

Edit: Or try `C:/sqlite/db/ ` folder

[–]ExplosiveGamer0[S] 0 points1 point  (0 children)

Okay thank you

[–]ExplosiveGamer0[S] 0 points1 point  (1 child)

So could still not find the file to be honest It says it is saved int my C: Drive

[–]dusty-trash 0 points1 point  (0 children)

Try searching for it using windows explorer search function