user2602079
user2602079

Reputation: 1393

Confirmation about approach to take to update information about an object - C# WPF

I have a puzzle game with levels. Each level is binary serialized once it is created and then loaded from a .dat file. I would like to save some information about a level when the user completes it. I would like it to have information about if it is solved yet and an int variable of how many turns the user took to solve it. I cannot delete the original .dat file of the level and then re-serialize it with the int variable "turnsTaken", because the starting positions of the characters will get messed up.

Can I have an SQL database with a table of Level names and solved values, as well as lowest Turns taken to solve each level? Then upon completion of a level, update those properties of the table? Then display them in my program?

This is really just a yes or no question, to get confirmation about if I should take this approach before i spend hours trying it. If no, then please explain a better approach. Thanks.

Upvotes: 0

Views: 30

Answers (1)

PCG
PCG

Reputation: 1207

Yes. You can save binary data to sql by storing it as type varbinary (a sql datatype).

Upvotes: 1

Related Questions