Checking in for clarity

I want to be absolutely sure I understand this part of the course, as it was the first time I got genuinely stuck. Even though I followed along with Rick and everything works correctly, I want to make sure I actually understand why before I continue. I tried to summarize how I personally understand it as a comment above the highlighted method.

If Rick or anyone for that matter can tell me ‘Hey! You got it!’ I would be super relieved, but I just want to be sure before I move on. If what I have here is incorrect, I would appreciate someone explaining where I am mistaken.

Thanks a lot!

-Andrew

Hi Ivicus,

Welcome to our community! :slight_smile:

Since reading long text on pictures/screenshots is always a bit exhausting for me, could you please share your text here as … well, text?

Sounds about right, you got this!

This is what I have written in the script as a note for myself Nina. Thank you Riley!

// [[IMPORTANT LESSON HERE]]
// This is a new concept introduced here and requires careful attention.
// Lets Break it Down. This is a public method which is not required to return
// anything (public void). The name of this method is SetWaveConfig, adopting a
// naming style in which ‘Get’ calls information and ‘Set’ changes information. It
// is then REQUIRING anything which calls this method to have the caller provide it
// with the value of a variable called waveConfig, which much be of type WaveConfig.
// The Action taken once this method recieves that information from the caller is
// setting the waveConfig variable defined in THIS SCRIPT’S references section to be equal to
// what the caller provided this method once it was called.
// [[IMPORTANT LESSON HERE]]

    public void SetWaveConfig(WaveConfig waveConfig)
    {
        this.waveConfig = waveConfig;
    }

That’s much better. Thank you! Now I can finally copy and paste a few lines from your description. :slight_smile:

I’m not sure if I understood you correctly. Inside the parentheses, we have the parameter of this method. The parameter got a name and acts as a local variable of type WaveConfig. When we call the method, we do not have to pass on a value of a variable with the same name.

The object we pass on must be of type WaveConfig. Alternatively, we could pass on “nothing” (null).

Here is an example:

WaveConfig abc = new WaveConfig(); // some WaveConfig object
SetWaveConfig(abc);

That’s almost right. Since you asked for feedback, I’m a bit nitpicking here. What you actually mean is the object/instance of this class. this.waveConfig is an instance member. It exists within the current object/instance only. Object or instance would be the correct term in the context of C#.

Apart from these two details, I don’t see any issue in your description. I think you understood correctly what is going on in our code. :slight_smile:

Thank you for the feedback Nina! I’m nearly finished with the Glitch Garden section now and things are really starting to set in. It has been about 20 lessons or so since I couldn’t do a challenge on my own!

Rick is an excellent instructor, it just took me a while to actually see the house he was building brick by brick, instead of just looking at the bricks.

I can relate to that. It’s difficult not to get lost in details.

Don’t worry if you cannot solve any challenge in this course yourself. Once you start developing your own game, you will have your own problems and your own ideas. You’ll have a house in mind, look for bricks and build it.

This topic was automatically closed after 13 days. New replies are no longer allowed.

Privacy & Terms