android - Java Deep Copy without Serialization -
I'm writing a card game for Android, and how to protect my game status, let me briefly tell my program For, I have a card that has a sprite class to display a bitmap image, a point for the position, and a border rectangular. I pass this class to create a card category, which has two bitmaps, whether or not to face above or below the card, and depending on calculations for the suit and rank storage. These card objects are in CardStacks objects in which there is an extra position, and there is an array list of cards. There are various cardstacks in the game model, and there are rules for driving cards between the heap. This game works very well.
Now I am trying to figure out how to save my game to the state. I want to serialize my entire game object and want to save it to a file. However, many objects (bitmap, point, rectangle, color, etc.) which are not serialized. In C #, I know that you can use memorystream and just copy the whole object, but I can not find the javascript, for which everything is not necessary to serialize. Is something similar in Java? Can I make my Game Model object any better? Any advice would be greatly appreciated. Thanks!
Goui tries in business objects and Gui Object explains these business objects
In this way, a card does not need to know that bitmap needs to be displayed (or even it is displayed at all)
There are business objects that you Want to serial and rebuild with GUI Deserialized objects
Comments
Post a Comment