Feedback on store class idea
Posted: Thu Jan 20, 2011 4:33 am
Hi,
I'm about to commit an update to rombot with a lot of changes. 1 of the things I ended up doing was create a 'store' class. The way it works is, whenever buying stuff, it loads the store data once only for that npc. From then on player merchant should run supper fast. It only changes the data when you visit a different store.
I need peoples opinion as to which functions should be moved to the store class. buyItem() was a no brainer. buyconsumables() wasn't so obvious because it also uses the inventory but seeing as it's about 'buying' I moved that too. The main 1 I'm not sure about is autosell(). It also uses the inventory but doesn't use the data stored in 'store'. Seeing as the 'store' class is mainly about the items for sale I'm not sure if a selling function should be moved to it. But then again selling is still a store function I guess.
What are people opinions?
I'm about to commit an update to rombot with a lot of changes. 1 of the things I ended up doing was create a 'store' class. The way it works is, whenever buying stuff, it loads the store data once only for that npc. From then on player merchant should run supper fast. It only changes the data when you visit a different store.
I need peoples opinion as to which functions should be moved to the store class. buyItem() was a no brainer. buyconsumables() wasn't so obvious because it also uses the inventory but seeing as it's about 'buying' I moved that too. The main 1 I'm not sure about is autosell(). It also uses the inventory but doesn't use the data stored in 'store'. Seeing as the 'store' class is mainly about the items for sale I'm not sure if a selling function should be moved to it. But then again selling is still a store function I guess.
What are people opinions?