storing item defs eg
Map<Integer, Item> defs = new HashMap<Integer, Item>();
to get do
Item item = defs.get(id);
to put do something like
Item item - new Item(363);
item.setName("cool item");
item.setExamine("Cheap cool item");
defs.put(363, item);
|
|

So I went and learned how to use hashmaps... What would be a good thing to apply them to on an rsps? Just figure I could use a bit of practice. Something easy though.

storing item defs eg
Map<Integer, Item> defs = new HashMap<Integer, Item>();
to get do
Item item = defs.get(id);
to put do something like
Item item - new Item(363);
item.setName("cool item");
item.setExamine("Cheap cool item");
defs.put(363, item);


my way caches the itemdef so u can get from the map instead of keep reading the file

Minigames, clan chat, etc

It's been used a lot for packet handling and command handling.
| « Bought 45$ VPS, want to start a RSPS! | [PI] Developers for Realms of Asteria » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |