Closed djsheehy closed 6 years ago
Good point. Pull request #118 already switches worlds to private Hashtable<String,World> worlds
, because worlds are now identified in the database by a unique string ID (which can be computed as a function of the coordinates). Next pull request I make on database stuff I will also switch users to private Hashtable<String,User> users
and update the getUser
method accordingly.
The getWorld method of GameUniverse looks up a world by x and y coordinates by going through every world in a list and checking each one. If you have a lot of worlds, this might get slow. Instead you should have a HashTable with coordinates as keys:
Then you can look them up much more efficiently.
The getUser method does the same thing. It should have a HashTable too to look them up by name.