Head First C# Code: Chapter 7 Explore the House Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace __Explore_the_House
{
public partial class Form1 : Form
{
Location currentLocation;
public Form1()
{
InitializeComponent();
CreateObjects();
MoveToANewLocation(livingRoom);
}
private void CreateObjects()
{
livingRoom = new RoomWithDoor("Living Room", "an antique carpet",
"an oak door with a brass knob");
diningRoom = new Room("Dining Room", "a crystal chandelier");
kitchen = new RoomWithDoor("Kitchen", "stainless steel appliances", "a screen door");
frontYard = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
backYard = new OutsideWithDoor("Back Yard", true, "a screen door");
garden = new Outside("Garden", false);
diningRoom.Exits = new Location[] { livingRoom, kitchen };
livingRoom.Exits = new Location[] { diningRoom };
kitchen.Exits = new Location[] { diningRoom };
frontYard.Exits = new Location[] { backYard, garden };
backYard.Exits = new Location[] { frontYard, garden };
garden.Exits = new Location[] { backYard, frontYard };