Designer:

- 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.
This commit is contained in:
Scionwest_cp 2010-01-31 19:02:06 -08:00
parent 2ec31c0170
commit efc49e35ce
12 changed files with 233 additions and 37 deletions

View file

@ -2,13 +2,41 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using MudDesigner.MudEngine.Interfaces;
using MudDesigner.MudEngine.GameObjects;
using MudDesigner.MudEngine.FileSystem;
using MudDesigner.MudEngine.GameCommands;
using MudDesigner.MudEngine.GameManagement;
using MudDesigner.MudEngine.GameObjects.Environment;
using MudDesigner.MudEngine.GameObjects.Items;
namespace MudDesigner.MudEngine.Characters
{
public class BaseCharacter : BaseObject
{
public Room CurrentRoom { get; set; }
public virtual void OnTravel(AvailableTravelDirections travelDirection)
{
if (CurrentRoom.DoorwayExist(travelDirection.ToString()))
{
string fileName = "";
if (CurrentRoom.Realm == "No Realm Associated.")
{
fileName = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Zones), CurrentRoom.Zone);
fileName = Path.Combine(fileName, "Rooms");
}
else
{
fileName = Path.Combine(FileManager.GetDataPath(CurrentRoom.Realm, CurrentRoom.Zone), "Rooms");
}
string connectedRoom = CurrentRoom.GetDoor(travelDirection).ConnectedRoom;
fileName = Path.Combine(fileName, connectedRoom);
fileName += ".room";
CurrentRoom = (Room)CurrentRoom.Load(fileName);
}
}
}
}

View file

@ -5,7 +5,7 @@ using System.Text;
namespace MudDesigner.MudEngine.Characters.Controlled
{
public class PlayerBasic
public class PlayerBasic : BaseCharacter
{
}
}

View file

@ -15,8 +15,6 @@ namespace MudDesigner.MudEngine.GameManagement
{
public class GameScript
{
ScriptObject _ScriptObject;
public GameScript()
{
}

View file

@ -112,12 +112,9 @@ namespace MudDesigner.MudEngine.GameManagement
[Browsable(false)]
public string ProjectPath { get; set; }
[Browsable(false)]
public StartingLocation InitialLocation
{
get;
set;
}
[Category("Environment Settings")]
[ReadOnly(true)]
public StartingLocation InitialLocation { get; set; }
[Browsable(false)]
public string Story
@ -126,6 +123,7 @@ namespace MudDesigner.MudEngine.GameManagement
set;
}
[Category("Object Setup")]
public string Filename
{
get
@ -142,6 +140,7 @@ namespace MudDesigner.MudEngine.GameManagement
_Filename = "Game.xml";
BaseCurrencyAmount = 1;
BaseCurrencyName = "Copper";
InitialLocation = new StartingLocation();
}
public void Save(string filename)

View file

@ -93,5 +93,15 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
return false;
}
public Door GetDoor(AvailableTravelDirections travelDirection)
{
foreach (Door door in this.Doorways)
{
if (door.TravelDirection == travelDirection)
return door;
}
return null;
}
}
}

View file

@ -10,5 +10,23 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
public string Room;
public string Zone;
public string Realm;
public override string ToString()
{
if (string.IsNullOrEmpty(Room))
return "No initial location defined.";
else
{
if (Realm == "No Realm Associated.")
{
return Zone + "->" + Room;
}
else
{
return Realm + "->" + Zone + "->" + Room;
}
}
}
}
}

View file

@ -57,6 +57,9 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
[Description("Collection of Rooms that have been created. Editing the Rooms Collection lets you manage the Zones rooms.")]
public List<Room> Rooms { get; set; }
[Category("Environment Information")]
public string EntranceRoom { get; set; }
public Zone()
{
Rooms = new List<Room>();