[dba-VB] On my ignorance and Inheritance

Stuart McLachlan stuart at lexacorp.com.pg
Sat Oct 15 18:23:24 CDT 2011


In that situation, I'd also look at  one Unit class and three interfaces iLand, iWater, iAir.

(Now that you are finally getting into real classes that can do that sort of thing <g>)

-- 
Stuart


On 15 Oct 2011 at 10:09, jwcolby wrote:

> So it seems that I could do a cell class which holds a bitmap pointer
> and an x/y location pair. Then my military units could inherit from
> the cell since they need the attributes of the cell.
> 
> Beyond that however things get gray.  All military units have
> properties such damage inflicted / absorbed, but there are also
> properties specific to the military units.  Land units cannot enter
> the water, ships cannot enter the land.  Air units can fly over
> either.  Things like that.
> 
> So it feels like I build a "military unit" class, inheriting from
> cell, with the commonality of all military units.  Then what?  Three
> subclasses of Land, water, air?
> 
> This is all pretty much new ground for me and I am excited to have
> such a clear cut reason to use inheritance.
> 





More information about the dba-VB mailing list