Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » Item.Mass - should this be an abstract property?
Re: Item.Mass - should this be an abstract property? Fri, 10 February 2012 15:05 Go to previous messageGo to previous message
ekolis is currently offline ekolis

 
Petty Officer 2nd Class
Stars! Nova developer
Stars! Nova developer

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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Production classes - IProductionUnit and derivates
Next Topic: Spam posts
Goto Forum:
  


Current Time: Sun Apr 28 23:51:14 EDT 2024