Re: Item.Mass - should this be an abstract property? |
Fri, 10 February 2012 15:05 |
|
ekolis | | | Messages: 51
Registered: May 2006 Location: Cincinnati, OH, USA |
|
|
Hmm, this doesn't look like it's going to work... Some Item subclasses should have writable mass, cost, etc. but others should not. Thus I'm faced with a dilemma: If I declare the properties read/write, then I'd have to throw exceptions in some of the setters, but if I declare them read-only, it would be impossible to set them when necessary (e.g. for components and hulls)! I can't even declare the property {get; protected set;} and then make the setter public on the appropriate subclasses! This could be worked around using interfaces somehow, but I'm not sure it's worth the trouble...
edit: Actually, I've got another idea... Why are all these things in Item anyway, if they don't apply equally to all items?! Maybe they should be pushed down to the appropriate subclasses... not sure exactly how that would work at the moment though!
[Updated on: Fri, 10 February 2012 15:08]
Mr. Flibble says...
Game over, boys!Report message to a moderator
|
|
|