/// <summary> /// Builds a new house in the yard /// </summary> /// <returns>The newly-built house</returns> public House BuildHouse() { if (HouseIsInYard()) { throw new BuildingCodeException("You can't build a second house in this yard."); } House house = new House(); Transfer(house).To(this); return house; }
/// <summary> /// Allows a wandering dog to wander into a particular house /// </summary> /// <param name="house">The house into which the dog will wander</param> public void WanderInto(House house) { CheckMovementRules(); house.Transfer(this).To(house); }