Sign in to follow this  
TheCrow33

[java] Saving Objects with Selective Information

Recommended Posts

TheCrow33    120
I'm developing a 3d world in java with opengl (perhaps eventually it will become a game) at the moment and I've made a Map class which is just a load of Tiles (simply a square on the floor). These tiles have Textures which are a global variable to the Tile class. So the problem is I want to load maps from a file, so at first I wrote a method for the map class that will parse a text file and load the Map accordingly, but for really big maps, the parsing is wicked slow. This is to be expected because disk read / write operations are wicked slow. So my next thought was to create another small program which will load the map from the text file and then save the object via implementing the Serializable class. My problem is that the Texture class, which the Tiles use to display images, is not Serializable.

So my question is, is there a way to have it skip that variable when it's saving the object? I may be losing my mind, but I could swear I covered doing this about a year ago in class and can't remember how to do it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this