Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

How do i solve this elegantly?

$
0
0

Hi everybody,

I am currently working on a turnbased strategy game like civilization. I am creating the game in C# using Visual Studio.

In the game i have defined several classes. Two of the relevant classes are Units and Buildings. A Unit can have different types, for example Archer, Spearman, etc. The same goes for a Building.

I have defined two Enums (BuildingType & UnitType). Each Unit or Building will have either UnitType or a BuildingType.

Of course, Buildings & Units behave differently. However, they can both be produced by a city. Besides these objects a city can also produce …


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>