From the course: Object-Oriented Programming with C#
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Go action - C# Tutorial
From the course: Object-Oriented Programming with C#
Go action
- [Instructor] Now we're ready to create our first action, go. This action will allow us to move between the rooms of the house. Before we create the new action class, let's go ahead and add the text that we need to our language and English classes. We're going to add two more properties that the go action will reference. The first being go, and the second being the go error. Now inside of our English class, we can write go and we can write the go error. Now it's time to create our go action. We'll add this to our actions folder. Now that we have our name space, let's create a new class called go that extends action. The first thing we're going to need to do is create a new name for this action, and we're going to do this by overriding the default name in the base class action. We'll use public override. Make this a string and call it name. If you remember previously we used the keyword virtual inside of our abstract…