[QUOTE=Darwin226;24438927]I don't know.
Btw, if there any reason why someone would do
public int Somethnig {
get {
return something;
}
set {
something=value;
}
}
?
Wouldn't it be easier to just set something as public?
I mean, I know what getters and setters are used for generally, but do they make sense in that example?[/QUOTE]
It might make sense for compatibility reasons. Let's say we have an application A, which have a plugin interface, and exposes class Foo, with the public field Bar. Plugin B uses Foo.Bar. Then, the creators of A decides that they have to do some validation on Foo.Bar, and converts it a property. This breaks plugin B, as accessing fields and properties, despite having identical syntax, is not the same. If Foo.Bar had been a property from the start, this wouldn't have been an issue.
While we are on the subject. If you have a struct point for example. And have a class Player with Point position.
Point has X and Y. If you make position a property you can't do Position.X++; right?
How do you fix that?
[QUOTE=ShaRose;24428079]Note that all objects [B]are[/B] classes. Even the built in types like int, string, long, even void. They are links to System.Int32, System.String, System.Int64, and System.Void respectively.[/QUOTE]
You meant that even primitive data-type [B]derive[/B] from base-classes. Objects are not classes. A class is a blueprint for an object.
Thread is now a C# question and answer party.
My question: What are some specific well-known games that are developed with C#?
[QUOTE=Darwin226;24442546]While we are on the subject. If you have a struct point for example. And have a class Player with Point position.
Point has X and Y. If you make position a property you can't do Position.X++; right?
How do you fix that?[/QUOTE]
After just reading what these guys have said my guess is you have a function that adds to X so
public void Xplus{
X++
}
then you call it with say
Possition.Xplus
This thread is the best of the Programming section since a while :3:
[QUOTE=Darwin226;24442546]If you make position a property you can't do Position.X++; right?[/QUOTE]
If Position is the property, it only needs to be a readable property for that to work. If X is the property, then it needs to be both readable and writable. But yeah, that works fine.
[QUOTE=Richy19;24444371]After just reading what these guys have said my guess is you have a function that adds to X so
public void Xplus{
X++
}
then you call it with say
Possition.Xplus[/QUOTE]
Properties are not methods, you shouldn't mix them up. (that code is illegal in more than one way, too)
[QUOTE=slashsnemesis;24444304]Thread is now a C# question and answer party.
My question: What are some specific well-known games that are developed with C#?[/QUOTE]
There is this game that was called Dyson, I forgot how it's named now.
I've also seen a Quake-port to C# with Silverlight.
I don't see the importance though. You might not be able to code the next CrySis in C# and expect the same framerate and memory-usage, but it will work well for every hobby-project I can imagine.
C# is also a perfectly fine language if you wanna try out something else later.
If you're not aiming to write a huge revolutionary game, you do not really need the extra performance of unmanaged code. (although I guess this is subjective, maybe it isn't true for everyone?)
[QUOTE=ZeekyHBomb;24444656]There is this game that was called Dyson, I forgot how it's named now.
I've also seen a Quake-port to C# with Silverlight.
I don't see the importance though. You might not be able to code the next CrySis in C# and expect the same framerate and memory-usage, but it will work well for every hobby-project I can imagine.
C# is also a perfectly fine language if you wanna try out something else later.[/QUOTE]
Well I know I'm not going to end up making the next cryengine I just want to know what this language can do. If I do start developing good games, I want to know what I can expect to be making. I just plan on making 2D maybe simple 3D games as of now.
If you have a 360 its easy to see what its capable of
just check out the indie section
Well it's too bad I don't have an Xbox v:v:v
[QUOTE=ZeekyHBomb;24444656]There is this game that was called Dyson, I forgot how it's named now.[/QUOTE]
[url=http://www.eufloria-game.com/]Eufloria[/url].
Sorry, you need to Log In to post a reply to this thread.