Confusion
Moderator: Coders of Rage
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Confusion
What I believe you're looking for is an entire meta-object system, not a normal OOP paradigm. However, you might want to look into constructors and object/variable declarations, because they might just be intrinsic and necessary parts of a programming language that supports OOP.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Confusion
OMG TY!!!! I have only skimmed a little throught the doc but it looks promising and I will fully read it later. THANK YOU SO MUCH!!!
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Confusion
... what? I wasn't suggesting a meta-object system, they're heavy, clunky and just overall unnecessary for most things. I was just saying that, in order to do what you want, you need one. However, a better idea is just to use a constructor.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Re: Confusion
This^Ginto8 wrote:However, a better idea is just to use a constructor.
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Confusion
Im trying to invision as to how to do that with a constructor. Or are you refering to some kind of OO design?
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Confusion
THe Floating Brain wrote:Im trying to invision as to how to do that with a constructor.
Code: Select all
Dude man(cow, calf, moose, earlobe);
no, I'm talking about a basic part of the language.THe Floating Brain wrote:Or are you refering to some kind of OO design?
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Confusion
Your diagram us not telling me much, you cant have a space in your class name is this a function is dude from a template or from a inherited class amongst calf, moose, earlobe? (your digram is confusing.Ginto8 wrote:THe Floating Brain wrote:Im trying to invision as to how to do that with a constructor.Code: Select all
Dude man(cow, calf, moose, earlobe);
no, I'm talking about a basic part of the language.THe Floating Brain wrote:Or are you refering to some kind of OO design?
Just making sure.Ginto8 wrote:no, I'm talking about a basic part of the language.THe Floating Brain wrote:Or are you refering to some kind of OO design?
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
Re: Confusion
In his example, "Dude" is the class, "man" is name of the instance, and "cow, calf, moose, earlobe" are the parameters for the constructor. When you create a class, you can override the constructor to perform other operations, so like:THe Floating Brain wrote:Your diagram us not telling me much, you cant have a space in your class name is this a function is dude from a template or from a inherited class amongst calf, moose, earlobe? (your digram is confusing.Ginto8 wrote:THe Floating Brain wrote:Im trying to invision as to how to do that with a constructor.Code: Select all
Dude man(cow, calf, moose, earlobe);
no, I'm talking about a basic part of the language.THe Floating Brain wrote:Or are you refering to some kind of OO design?
Code: Select all
class Dude
{
public:
Dude() {
//do stuff here...
}
};
Code: Select all
class Dude
{
public:
Dude(SomeOtherClass instanceOfSomeOtherClass) {
//Do stuff here
}
};
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Confusion
It wasn't a declaration of a class; it was a variable declaration. Presuming that Dude is a class with a constructor that takes the types of cow, calf, moose and earlobe as parameters (they're just random variables), then man is initialized as such.THe Floating Brain wrote:Your diagram us not telling me much, you cant have a space in your class name is this a function is dude from a template or from a inherited class amongst calf, moose, earlobe? (your digram is confusing.Ginto8 wrote:THe Floating Brain wrote:Im trying to invision as to how to do that with a constructor.Code: Select all
Dude man(cow, calf, moose, earlobe);
no, I'm talking about a basic part of the language.THe Floating Brain wrote:Or are you refering to some kind of OO design?
Obviously you have not learned enough about types and classes. Look here. If that's too confusing, or you have other issues, try starting at the beginning.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- adikid89
- Chaos Rift Cool Newbie
- Posts: 94
- Joined: Tue Apr 27, 2010 6:59 am
- Current Project: small tiny-mini projects
- Favorite Gaming Platforms: PC I guess...
- Programming Language of Choice: c++
Re: Confusion
Yes! http://www.cplusplus.com/doc/tutorial/classes/ is the best c++ tutorial out there, and they also have a forum where you can post questions and they get answered quickly. I love that site, learned so much there!Ginto8 wrote:Obviously you have not learned enough about types and classes. Look here. If that's too confusing, or you have other issues, try starting at the beginning.
My first game C++/SDL Yoshi Combat! = http://www.youtube.com/watch?v=HQ9mMBEWSZg
==============================================================
==============================================================
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Confusion
+1adikid89 wrote:Yes! http://www.cplusplus.com/doc/tutorial/classes/ is the best c++ tutorial out there, and they also have a forum where you can post questions and they get answered quickly. I love that site, learned so much there!
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Confusion
Originally I thought it was a constructor. What confused me was the white space between Dude and man (I do not usualy use constructors in that fashion) and you did not explain if cow earlobe etc. were instances of a class private members of that particular class or something else. Again I do understand C++ the way you wrote it was just a little confusing.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
Re: Confusion
That's how you'd normally statically allocate an object with a constructor having parameters... What I really don't understand, is why after countless people have told your to review some C++ topics, you refuse and go on to say you know C++, and we've shown time and time again, that you should review this stuff. Regardless of how well (you think) you know it, it's blatantly obvious (in my opinion), that you need to review some stuff.THe Floating Brain wrote:Originally I thought it was a constructor. What confused me was the white space between Dude and man (I do not usualy use constructors in that fashion) and you did not explain if cow earlobe etc. were instances of a class private members of that particular class or something else. Again I do understand C++ the way you wrote it was just a little confusing.
You came here to ask a question, which implies that you are going to trust whatever input we give you... One of those pieces of input is that you should review general use of classes to better familiarize yourself with concepts.
But in the end, the choice is yours...
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Confusion
I understand were you are coming from. But I realy have a good grasp on C++ I understand it very well (I <3 C++ ). Somtimes I would even spend a month or two going over the same tutorial until I knew I got it right then practice then consult poeple I knew in real life and reapeat (when I was learning for the past 3 years). Also you have to understand I did just get out of the command promp/game maker 8 stage (which I stayed in for about 4 months) I am new to game dev (about 7 months in) and a fourm with programmers of this level. (Not saying all the programmers on antiRTFM's fourm are not exparanced.) I know I usialy sound like a idout and I kick myself everytime I do but I do have a better understanding then I let off.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
Re: Confusion
Stop trying to learn the basics with tutorials and online sources. Buy a book. Most books assume you don't know anything about the language and explain things in extra detail so you understand them. You have been practicing c++ for 3 years.... Have you ever thought that maybe online sources weren't the best place to start at?