Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 01 Sep 2011
Offline Last Active Mar 25 2015 01:11 AM

Posts I've Made

In Topic: Card game Class Structure

24 March 2015 - 02:33 PM

Thank you very much for the elaboration Xai, i will definitely keep these in mind when constructing my game. I now also see that this form of composition is quite related to an object oriented approach. Although i do have to improve my skills with interfaces and specific C# stuff like delegates, i get the global idea and should be able to get this working one way or the other.


Thanks again!

In Topic: Card game Class Structure

21 March 2015 - 01:19 PM

great, thanks a lot! I will definitely give that a try :)

In Topic: Card game Class Structure

19 March 2015 - 01:43 PM

Thank you very much for the responses everybody! Since i am quite new to this topic (and to programming in general), what would be the correct terms to Google for an example or maybe even a tutorial in C# for a compositional approach?

In Topic: Class inheritance?

04 January 2014 - 10:55 AM

All right, thank you very much for responding everybody :-)


If i try to summarize your findings, i come to the following conclusions:

  • If the behaviour of all the different enemies is  the same, the best way to code everything is one of the following:
    1. Pass the type to the constructor, then use a switch statement in the constructor to set the different values
    2. Pass the different values directly to the constructor

When considering these methods i prefer the first one, since it will allow me to create new enemies easier. An even more advanced approach would be to dynamically generate the enemies by loading them from an external data file. 


  • If the behaviour of the enemies is different, composition is the best option. This is something new to me (i am not yet very experienced) but something i will definitely look into.


I hope the above is correct. Thank you very much for all your replies.

In Topic: Class inheritance?

29 December 2013 - 10:43 AM

Thank you, i will look into that. I thought that such a method should exist but have never worked with if before. What is a good file format to use for such a file? XML? Any examples would be very much appreciated.