Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

First chapter done.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Durfy   Members   

109
Like
0Likes
Like

Posted 08 August 2007 - 05:31 AM

Yeah I signed up but I've been so busy until recently. I finally got through the first chapter. I have to say that C# looks like a pretty impressive language. I have a few questions though ( I come from C++(intermediate) ) I dont quite understand interfaces. Say I have
interface i {
  void SetColor(Color color);
}

and I implement it in a class like so class Ball : i does that mean that Ball must contain the method SetColor with the same signature? also if interface has a member(variable) would that mean that Ball will inherit that? The other subject I was completely lost on is delegates. Should I just read more and eventually I'll learn, or should I understand the basic concept at this point. (it mentioned C++ function pointers but i'm lost there too) Thanks for your time, -durfy

#2 Telastyn   Members   

3777
Like
0Likes
Like

Posted 08 August 2007 - 05:39 AM

Quote:
Original post by Durfy
does that mean that Ball must contain the method SetColor with the same signature?


Yes, or compiler error.

Quote:

also if interface has a member(variable) would that mean that Ball will inherit that?


Interfaces may not contain member variables.

Quote:

The other subject I was completely lost on is delegates. Should I just read more and eventually I'll learn, or should I understand the basic concept at this point. (it mentioned C++ function pointers but i'm lost there too)


If you're not familiar with C++ function pointers then you should read more. If you are, then in C# the delegate keyword acts as a C++ typedef for a function pointer. That may then be used to declare and use delegate objects which are more like C++ function pointers, only less icky.



#3 Durfy   Members   

109
Like
0Likes
Like

Posted 08 August 2007 - 05:42 AM

Thanks a lot dude.
I will keep reading.
Hopefully I will power through a couple chapters and catch up.
Thanks,
-durfy




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.