Thanks so much! I've been waiting months for this one. Your tutorials are great. (Though your voice in this one is pretty close to the noise floor. I had to run it through louder speakers than my MacBook Pro provides to hear you over me eating nachos for dinner. ;-) ) A couple questions: 1. any reason you didn't use a Property for _paused? 2. What's ": this( coroutine, true )"? I don't think I've come across that syntax.
@JessyUV one day I will invest in a mic instead of using the built in one.
1. Allowing set for paused would totally work fine and there is no specific reason it wasn't done. There are always lots of ways to doing things in the land of C# so you can always take your pick.
2. this( coroutine, true ) will call the 2nd constructor that takes in 2 parameters. If Job were a subclass of some other class something like base( coroutine, true ) would call the subclasses constructor.
@prime31studios So, is it the same as defining the second method like this? public Job (IEnumerator coroutine, bool shouldStart = true)...? I'm confused by what you're saying about subclassing.
@JessyUV having just a single constructor with the method signature you posted would have an identical affect. I don't yet use default param values yet though because MonoDevelop hates them. Here is a subclass example:
class A
{ public A(){} public A( string input ){}
}
class B : A
{ public B(){} public B( string input ) : base( input ){} // this would end up calling the 2nd of A's constructors
Thanks so much! I've been waiting months for this one. Your tutorials are great. (Though your voice in this one is pretty close to the noise floor. I had to run it through louder speakers than my MacBook Pro provides to hear you over me eating nachos for dinner. ;-) ) A couple questions: 1. any reason you didn't use a Property for _paused? 2. What's ": this( coroutine, true )"? I don't think I've come across that syntax.
JessyUV 5 months ago
@JessyUV one day I will invest in a mic instead of using the built in one.
1. Allowing set for paused would totally work fine and there is no specific reason it wasn't done. There are always lots of ways to doing things in the land of C# so you can always take your pick.
2. this( coroutine, true ) will call the 2nd constructor that takes in 2 parameters. If Job were a subclass of some other class something like base( coroutine, true ) would call the subclasses constructor.
prime31studios 5 months ago
@prime31studios So, is it the same as defining the second method like this? public Job (IEnumerator coroutine, bool shouldStart = true)...? I'm confused by what you're saying about subclassing.
JessyUV 5 months ago
@JessyUV having just a single constructor with the method signature you posted would have an identical affect. I don't yet use default param values yet though because MonoDevelop hates them. Here is a subclass example:
class A
{ public A(){} public A( string input ){}
}
class B : A
{ public B(){} public B( string input ) : base( input ){} // this would end up calling the 2nd of A's constructors
}
prime31studios 5 months ago
the formatting on that got smashed! copy/paste it into MonoDevelop and let MD format it back to normal.
prime31studios 5 months ago