• Welcome to Valhalla Legends Archive.
 

Classes

Started by MoNksBaNe_Agahnim, January 02, 2004, 11:49 PM

Previous topic - Next topic

MoNksBaNe_Agahnim

Hey hey,

I may get flamed but oh well. I have been studing classes for a couple of days now and am wondering what a good project, not necessarly one as big as a bot, to practice with, my teacher doesn't know crap about C++ and all the tutorials I have used don't give you an excercise. So what is a good program to mess around with to better understand classes.

**Note** I haven't gotten much into inheratence or any of Polymorphism.

Thanks for help ^^

iago

Well, if you don't mind Java code, I can show you examples of inheritance/polymorphism fairly easily (try http://www.valhallalegends.com/iago/JavaBot.rar, I think that's the right link).  That one uses polymorphism to process events.  It's basically done the same way in C++ *except* you have to declare the function as virtual, so instead of this java:
public class moo
{
public boolean iagorox() { return true; }
}


you'd have this equivolant c++:

class moo
{
public:
virtual bool iagorox() { return true; }
}


but take a look at that code, see if you can tell what's happening.  You don't even have to run it, but if you want to anyway get java+netbeans from java.sun.com.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


MoNksBaNe_Agahnim