MudEngine:
- Re-organized property layout in Game.cs - Realm now automatically sets Zone.Realm when a Zone is added via Realm.AddZone() - Zone now automatically sets Room.Zone and Room.Realm when Room is added via Zone.AddRoom() MudOfflineExample: - Updated to reflect the changes made to MudEngine.
This commit is contained in:
parent
765966745d
commit
26afd9a9e1
4 changed files with 37 additions and 38 deletions
|
@ -56,19 +56,6 @@ namespace MudEngine.GameManagement
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public bool IsRunning { get; internal set; }
|
public bool IsRunning { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or Sets if all objects will be laoded during server startup. Enabling this results in a slower server start time, but faster object access.
|
|
||||||
/// </summary>
|
|
||||||
[Category("Project Settings")]
|
|
||||||
[Description("If enabled, all objects will be loaded during server startup resulting in a slower server start time, but faster load time during gameplay")]
|
|
||||||
public bool PreCacheObjects { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or Sets the path to the current project
|
|
||||||
/// </summary>
|
|
||||||
[Browsable(false)]
|
|
||||||
public string ProjectPath { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets the paths to various project related objects.
|
/// Gets or Sets the paths to various project related objects.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -78,6 +65,19 @@ namespace MudEngine.GameManagement
|
||||||
/// Gets the scripting engine used by the game.
|
/// Gets the scripting engine used by the game.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ScriptEngine scriptEngine { get; internal set; }
|
public ScriptEngine scriptEngine { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the path to the current project
|
||||||
|
/// </summary>
|
||||||
|
[Browsable(false)]
|
||||||
|
public string ProjectPath { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets if all objects will be laoded during server startup. Enabling this results in a slower server start time, but faster object access.
|
||||||
|
/// </summary>
|
||||||
|
[Category("Project Settings")]
|
||||||
|
[Description("If enabled, all objects will be loaded during server startup resulting in a slower server start time, but faster load time during gameplay")]
|
||||||
|
public bool PreCacheObjects { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Game Information
|
#region Game Information
|
||||||
|
@ -106,6 +106,27 @@ namespace MudEngine.GameManagement
|
||||||
[Description("The current working version of the game.")]
|
[Description("The current working version of the game.")]
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public List<Currency> CurrencyList { get; set; }
|
||||||
|
|
||||||
|
[Category("Environment Settings")]
|
||||||
|
[ReadOnly(true)]
|
||||||
|
public Realm InitialRealm
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the collection of Realms currently stored in the Game.
|
||||||
|
/// </summary>
|
||||||
|
public List<Realm> RealmCollection { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Story that is displayed on initial player entry into the game
|
||||||
|
/// </summary>
|
||||||
|
public string Story { get; set; }
|
||||||
|
|
||||||
[Category("Project Settings")]
|
[Category("Project Settings")]
|
||||||
[Description("Enable or Disable Auto-saving of players when the player travels")]
|
[Description("Enable or Disable Auto-saving of players when the player travels")]
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -150,26 +171,6 @@ namespace MudEngine.GameManagement
|
||||||
[Category("Game Currency")]
|
[Category("Game Currency")]
|
||||||
[DefaultValue("Copper")]
|
[DefaultValue("Copper")]
|
||||||
public string BaseCurrencyName { get; set; }
|
public string BaseCurrencyName { get; set; }
|
||||||
|
|
||||||
[Browsable(false)]
|
|
||||||
public List<Currency> CurrencyList { get; set; }
|
|
||||||
|
|
||||||
[Category("Environment Settings")]
|
|
||||||
[ReadOnly(true)]
|
|
||||||
public Realm InitialRealm
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the collection of Realms currently stored in the Game.
|
|
||||||
/// </summary>
|
|
||||||
public List<Realm> RealmCollection { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The Story that is displayed on initial player entry into the game
|
|
||||||
/// </summary>
|
|
||||||
public string Story { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Networking
|
#region Networking
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace MudEngine.GameObjects.Environment
|
||||||
|
|
||||||
//TODO: Check fo duplicates
|
//TODO: Check fo duplicates
|
||||||
ZoneCollection.Add(zone);
|
ZoneCollection.Add(zone);
|
||||||
|
zone.Realm = Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,8 @@ namespace MudEngine.GameObjects.Environment
|
||||||
|
|
||||||
//TODO: Check for duplicate Rooms.
|
//TODO: Check for duplicate Rooms.
|
||||||
RoomCollection.Add(room);
|
RoomCollection.Add(room);
|
||||||
|
room.Zone = Name;
|
||||||
|
room.Realm = Realm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LinkRooms(AvailableTravelDirections departureDirection, Room arrivalRoom, Room departureRoom)
|
public void LinkRooms(AvailableTravelDirections departureDirection, Room arrivalRoom, Room departureRoom)
|
||||||
|
|
|
@ -37,15 +37,12 @@ namespace MUDGame
|
||||||
zone.IsSafe = true;
|
zone.IsSafe = true;
|
||||||
zone.StatDrain = false;
|
zone.StatDrain = false;
|
||||||
zone.IsInitialZone = true;
|
zone.IsInitialZone = true;
|
||||||
zone.Realm = realm.Name;
|
|
||||||
realm.AddZone(zone);
|
realm.AddZone(zone);
|
||||||
|
|
||||||
Room bedroom = new Room(game);
|
Room bedroom = new Room(game);
|
||||||
bedroom.Name = "Bedroom";
|
bedroom.Name = "Bedroom";
|
||||||
bedroom.DetailedDescription.Add("This is your bedroom, it's small but comfortable. You have a bed, a book shelf and a rug on the floor.");
|
bedroom.DetailedDescription.Add("This is your bedroom, it's small but comfortable. You have a bed, a book shelf and a rug on the floor.");
|
||||||
bedroom.DetailedDescription.Add("You may walk to the WEST to find you Closet.");
|
bedroom.DetailedDescription.Add("You may walk to the WEST to find you Closet.");
|
||||||
bedroom.Zone = zone.Name;
|
|
||||||
bedroom.Realm = realm.Name;
|
|
||||||
bedroom.IsInitialRoom = true;
|
bedroom.IsInitialRoom = true;
|
||||||
zone.AddRoom(bedroom);
|
zone.AddRoom(bedroom);
|
||||||
|
|
||||||
|
@ -53,8 +50,6 @@ namespace MUDGame
|
||||||
closet.Name = "Closet";
|
closet.Name = "Closet";
|
||||||
closet.DetailedDescription.Add("Your closet contains clothing and some shoes.");
|
closet.DetailedDescription.Add("Your closet contains clothing and some shoes.");
|
||||||
closet.DetailedDescription.Add("You may walk to your EAST to find your Room.");
|
closet.DetailedDescription.Add("You may walk to your EAST to find your Room.");
|
||||||
closet.Zone = zone.Name;
|
|
||||||
closet.Realm = realm.Name;
|
|
||||||
zone.AddRoom(closet);
|
zone.AddRoom(closet);
|
||||||
|
|
||||||
zone.LinkRooms(AvailableTravelDirections.West, closet, bedroom);
|
zone.LinkRooms(AvailableTravelDirections.West, closet, bedroom);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue