MudEngine:
- Fixed command engine stalling when waiting for one users command to finish before starting another users command. - Commands are loaded into static List collections, but the Execute command itself is now no longer static. - Player.CommandSystem property added so each player has their own commandengine to process their input.
This commit is contained in:
parent
b3a672503f
commit
7c6ca6a2b9
5 changed files with 49 additions and 36 deletions
|
@ -45,12 +45,18 @@ namespace MudEngine.GameObjects.Characters
|
|||
/// </summary>
|
||||
public Bag Inventory { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a working copy of the CommandEngine used by the player.
|
||||
/// </summary>
|
||||
public CommandEngine CommandSystem { get; internal set; }
|
||||
|
||||
public BaseCharacter(Game game) : base(game)
|
||||
{
|
||||
ActiveGame = game;
|
||||
IsActive = false;
|
||||
CurrentRoom = game.InitialRealm.InitialZone.InitialRoom;
|
||||
Inventory = new Bag(game);
|
||||
CommandSystem = new CommandEngine();
|
||||
|
||||
}
|
||||
|
||||
|
@ -123,7 +129,7 @@ namespace MudEngine.GameObjects.Characters
|
|||
{
|
||||
//TODO: Character class can handle a lot of the command management here, checking various things prior to sending
|
||||
//the command off to the command engine for execution.
|
||||
CommandResults result = CommandEngine.ExecuteCommand(command, this);
|
||||
CommandResults result = CommandSystem.ExecuteCommand(command, this);
|
||||
|
||||
if (result.Result != null)
|
||||
{
|
||||
|
@ -191,7 +197,7 @@ namespace MudEngine.GameObjects.Characters
|
|||
{
|
||||
if (IsActive)
|
||||
{
|
||||
string filePath = Path.Combine(ActiveGame.DataPaths.Players, Filename);
|
||||
string filePath ="" /*= Path.Combine(ActiveGame.DataPaths.Players, Filename)*/;
|
||||
this.Save(filePath);
|
||||
|
||||
IsActive = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue