|
Thorbjorn,Ideally you do not want to spread responsibility. The moment your item "knows" about inventory classes and inventory sub classes it has received the responsibility to handle those lookup values correctly, which doesn't necessarily make sense.
Thanks for the information. I had a feeling I was not going about this in
the best way.
So, if I understand correctly, ideally you don't want to care what an item
"has", just what an item does.
In RPG I would look the item up in the item file and do what I want with theThe major thing to get your head around with, is that code and data mentally sort of go together. If some kinds of data warrant special treatment you want to see if you can isolate that treatment and put it along with the data using inheritance.
data. I'm still trying to break that mindset and I'm finding it hard. Once I
introduce data into an object I keep having the idea I need to be able to
look at that data. Still don't understand it yet, but I think/hope I'm
getting it.
re, but here is a link to the source
for the ListFactory.
http://code.midrange.com/9b26a9bd93.html
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.