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.

Decorating rooms

Decorating rooms

- [Instructor] Right now our rooms are kind of boring, so let's take a look at a way to change the description to something a bit more interesting and random. We'll need to add some descriptions to the language class first. Let's create a new property for the room descriptions and we'll type it to a string list. Next, we'll need to go into our English class and add the descriptions. We'll add the following strings to our list. Normal, cold, warm, dark, bright, scary, and strange. Before we leave this class, we need to modify our default room description to add an additional token where we can insert one of these descriptions. Don't forget to change the original token to 1. This way, the compiler doesn't throw an error when we try to use string.format. Now it's time for us to create a new partial class called House.Decorate.cs. Once you've added the boiler plate code, we need to create the partial class for house. Let's…

Contents