- Rooms can now be linked automatically via the new Zone.LinkRooms method. Room linking can no longer be done manually as the Doorways property is now read-only. - Door.Description has been removed. Doorway description will need to be included in Room.Description or Room.DetailedDescription properties. - Added DetailedDescription to make creating multi-line descriptions easier. Not supported by the Look command yet. - Game.IsRunning is now read-only. The Game will manage this property on its own. - BaseCharacter.ExecuteCommand now will always return a string. Simplifying the game loop for users as they no longer need to check what Type was returned by the command. - Doors now contain a DepartureRoom and a ArrivalRoom property allowing for easy access to Rooms that are linked together. - Fixed a bug where Game, Realms and Zones always assigned IsInitial to Realms, Zones and Rooms when added to the collections. Collection would contain multiple IsInitial objects. - Removed Room.InstalledDoorways property as that was used only by the old Designer - Removed Room.Load() as that implementation of it is obsolete. MudGame: - Revised Zeroth to build it's Zone and Rooms using the new Zone.LinkRooms function. - Greatly revised Program.cs and the Game loop to take advantage of many of the automations provided by the Engine now.
64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using MudEngine.GameManagement;
|
|
using MudEngine.GameObjects;
|
|
using MudEngine.GameObjects.Environment;
|
|
|
|
namespace MUDGame.Environments
|
|
{
|
|
internal class Zeroth
|
|
{
|
|
Game game;
|
|
Realm realm;
|
|
|
|
internal Zeroth(Game game)
|
|
{
|
|
this.game = game;
|
|
realm = new Realm();
|
|
}
|
|
|
|
internal void BuildZeroth()
|
|
{
|
|
realm.Name = "Zeroth";
|
|
realm.Description = "The land of " + realm.Name + " is fully of large forests and dangerous creatures.";
|
|
realm.IsInitialRealm = true;
|
|
|
|
//Build Rooms.
|
|
BuildHome();
|
|
}
|
|
|
|
private void BuildHome()
|
|
{
|
|
//Build Zones
|
|
Zone zone = new Zone();
|
|
zone.Name = "Home";
|
|
zone.Description = "Your home is small and does not contain many items, but it's still your home and someplace you can relax after your battles.";
|
|
zone.IsSafe = true;
|
|
zone.StatDrain = false;
|
|
zone.IsInitialZone = true;
|
|
|
|
Room bedroom = new Room();
|
|
bedroom.Name = "Bedroom";
|
|
bedroom.Description = "This is your bedroom, it's small but comfortable. You have a bed, a book shelf and a rug on the floor.";
|
|
bedroom.Zone = zone.Name;
|
|
bedroom.Realm = realm.Name;
|
|
bedroom.IsInitialRoom = true;
|
|
|
|
Room closet = new Room();
|
|
closet.Name = "Closet";
|
|
closet.Description = "Your closet contains clothing and some shoes.";
|
|
closet.Zone = zone.Name;
|
|
closet.Realm = realm.Name;
|
|
|
|
zone.LinkRooms(AvailableTravelDirections.West, closet, bedroom);
|
|
|
|
zone.Realm = realm.Name;
|
|
|
|
realm.AddZone(zone);
|
|
game.AddRealm(realm);
|
|
}
|
|
}
|
|
}
|