Mud Designer:
- Removed from solution Mud Engine: - Moved the CommandEngine, CommandResults and ICommand Interface out from the Commands namespace and into GameManagement since they manage the game commands. - Added CommandExit class to provide the ability to exit a game once running. This is fully implemented. - Realms, Zones and Rooms now have an IsInitial property for determining if this is an initial location for the Game. - Renamed GameSetup to Game. - Corrected GameObject being in the incorrect namespace. - Corrected the ScriptEngine not - CommandEngine no longer needs a Name argument. Arguments changed from 5 to 4 due to this change. Mud Game: - Added Example Game used for testing various MUDEngine features and testing constructability of games using the engine. - Currently only contains 1 Realm, 1 Zone and Two Rooms. Only working command is Exit.
This commit is contained in:
parent
06266b7245
commit
b8f6be12c0
16 changed files with 374 additions and 40 deletions
|
@ -1,167 +0,0 @@
|
|||
//Microsoft .NET Framework
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
//MUD Engine
|
||||
using MudEngine.FileSystem;
|
||||
using MudEngine.GameObjects;
|
||||
using MudEngine.GameObjects.Environment;
|
||||
|
||||
namespace MudEngine.GameManagement
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages all of the projects settings.
|
||||
/// </summary>
|
||||
[XmlInclude(typeof(StartingLocation))]
|
||||
[XmlInclude(typeof(Currency))]
|
||||
public class GameSetup
|
||||
{
|
||||
public enum TimeOfDayOptions
|
||||
{
|
||||
AlwaysDay,
|
||||
AlwaysNight,
|
||||
Transition,
|
||||
}
|
||||
|
||||
[Category("Company Settings")]
|
||||
[Description("The name of the Company or Author building the game.")]
|
||||
/// <summary>
|
||||
/// Gets or Sets the name of the company
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
[Category("Company Settings")]
|
||||
[Description("The website URL that a player can visit to view additional information related to the game")]
|
||||
/// <summary>
|
||||
/// Gets or Sets the companies website for this project
|
||||
/// </summary>
|
||||
public string Website { get; set; }
|
||||
|
||||
[Category("Project Settings")]
|
||||
[Description("The name of the game displayed to the users, and title bar of the runtime.")]
|
||||
public string GameTitle { get; set; }
|
||||
|
||||
[Category("Project Settings")]
|
||||
[Description("Enable or Disable Auto-saving of players when the player travels")]
|
||||
/// <summary>
|
||||
/// Gets or Sets if the game autosaves when the player changes locations.
|
||||
/// </summary>
|
||||
public bool AutoSave { get; set; }
|
||||
|
||||
[Category("Project Settings")]
|
||||
[Description("Hide Room names from being outputted to the console.")]
|
||||
/// <summary>
|
||||
/// Gets or Sets if room names are hidden during console output.
|
||||
/// </summary>
|
||||
public bool HideRoomNames { get; set; }
|
||||
|
||||
[Category("Day Management")]
|
||||
[Description("Set what time of day the world will take place in.")]
|
||||
public TimeOfDayOptions TimeOfDay
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Day Management")]
|
||||
[Description("Set how long in minutes it takes to transition from day to night.")]
|
||||
public int TimeOfDayTransition
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Day Management")]
|
||||
[Description("Sets how long in minutes a day lasts in the game world.")]
|
||||
public int DayLength
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Project Settings")]
|
||||
[Description("The current working version of the game.")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[Category("Game Currency")]
|
||||
[DefaultValue(1)]
|
||||
[Description("Sets the amount that the base currency is valued at.")]
|
||||
public uint BaseCurrencyAmount { get; set; }
|
||||
|
||||
|
||||
[Category("Game Currency")]
|
||||
[DefaultValue("Copper")]
|
||||
public string BaseCurrencyName { get; set; }
|
||||
|
||||
|
||||
|
||||
//TODO: Add Party support.
|
||||
[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; }
|
||||
|
||||
[Browsable(false)]
|
||||
public List<Currency> CurrencyList { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public string ProjectPath { get; set; }
|
||||
|
||||
[Category("Environment Settings")]
|
||||
[ReadOnly(true)]
|
||||
public StartingLocation InitialLocation { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public string Story
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Object Setup")]
|
||||
public string Filename
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Filename;
|
||||
}
|
||||
}
|
||||
private string _Filename;
|
||||
|
||||
public GameSetup()
|
||||
{
|
||||
CurrencyList = new List<Currency>();
|
||||
GameTitle = "New Game";
|
||||
_Filename = "Game.xml";
|
||||
BaseCurrencyAmount = 1;
|
||||
BaseCurrencyName = "Copper";
|
||||
InitialLocation = new StartingLocation();
|
||||
}
|
||||
|
||||
public void Save(string filename)
|
||||
{
|
||||
string directory = Path.GetDirectoryName(filename);
|
||||
|
||||
if (!Directory.Exists(directory))
|
||||
Directory.CreateDirectory(directory);
|
||||
|
||||
FileManager.Save(filename, this);
|
||||
}
|
||||
|
||||
public object Load(string path)
|
||||
{
|
||||
string fileName = Path.Combine(path, _Filename);
|
||||
if (!File.Exists(fileName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return FileManager.Load(fileName, this);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue