- Designer now has a status bar to show when various things are completed successfully. - The Offline Runtime can now be launched via the Designers Project menu. - Designer now features a 'Set As Initial Location' item within the Right-Click menu. Right Click on a Zone and assign it as your projects initial starting location. Engine: - BaseCharacter class fleshed out a little bit. Now includes an OnTravel method for player travel code. - PlayerBasic class now inherits from BaseCharacter. - ProjectInformation now supports setting the games initial zone location. - ProjectInformation.Filename is now placed within a category (Object Settings) within the Property Pane of the Designer. - Room.GetDoor method added for returning a specified door with the matching travel direction. - StartingLocation now overrides ToString to return the location that's currently assigned to it for use within the Designer. - Zone class now has an EntranceRoom Property for settings the default entrance room for the Zone. This is used by the Runtime and the designer when setting and retrieving the InitialLocation. Offline Runtime: - Now creates a basic player, loads the project and places the player within the entrance room designated by the InitialLocation.Zone - Runtime contains code that automatically moves the player to the north during startup. This will be removed, it's only there for testing purposes. - Runtime does not print anything to the console yet.
107 lines
3 KiB
C#
107 lines
3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Xml.Serialization;
|
|
using System.Drawing.Design;
|
|
|
|
using MudDesigner.MudEngine.UITypeEditors;
|
|
|
|
namespace MudDesigner.MudEngine.GameObjects.Environment
|
|
{
|
|
[XmlInclude(typeof(Door))]
|
|
public class Room : BaseObject
|
|
{
|
|
[Category("Environment Information")]
|
|
[Description("Shows what rooms are currently created and linked to within this Room.")]
|
|
[ReadOnly(true)]
|
|
public string InstalledDoorways
|
|
{
|
|
get
|
|
{
|
|
string installed = "";
|
|
if (this.Doorways.Count != 0)
|
|
{
|
|
foreach (Door d in Doorways)
|
|
{
|
|
installed += d.TravelDirection.ToString() + ",";
|
|
}
|
|
if (Doorways.Count >= 2)
|
|
{
|
|
installed = installed.Substring(0, installed.Length - 1);
|
|
}
|
|
return installed;
|
|
}
|
|
else
|
|
return "None Installed.";
|
|
}
|
|
}
|
|
|
|
[Category("Environment Information")]
|
|
[Description("Allows for linking of Rooms together via Doorways")]
|
|
[EditorAttribute(typeof(UIDoorwayEditor), typeof(UITypeEditor))]
|
|
[RefreshProperties(RefreshProperties.All)]
|
|
public List<Door> Doorways
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ReadOnly(true)]
|
|
[Description("This is the Zone that the Room is currently assigned to.")]
|
|
[Category("Environment Information")]
|
|
public string Zone
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ReadOnly(true)]
|
|
[Description("This is the Realm that the Room belongs to.")]
|
|
[Category("Environment Information")]
|
|
public string Realm
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Category("Environment Information")]
|
|
[DefaultValue(false)]
|
|
[Description("Determins if the Player can be attacked within this Room or not.")]
|
|
public bool IsSafe
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public Room()
|
|
{
|
|
Doorways = new List<Door>();
|
|
|
|
IsSafe = false;
|
|
}
|
|
|
|
public bool DoorwayExist(string travelDirection)
|
|
{
|
|
foreach (Door door in Doorways)
|
|
{
|
|
if (door.TravelDirection.ToString().ToLower() == travelDirection.ToLower())
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public Door GetDoor(AvailableTravelDirections travelDirection)
|
|
{
|
|
foreach (Door door in this.Doorways)
|
|
{
|
|
if (door.TravelDirection == travelDirection)
|
|
return door;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|