MudEngine:
- Re-worked the command system. All commands now only need 2 arguments rather than 4. The actual command string and the Player - All commands updated to work with the new command system - Look command now works in the example MudGame - Realm now contains InitialZone for the starting Zone within that Realm. - Zone now contains InitialRoom for the starting Room within that Zone. - All Environment objects now contains a Initial property and Add() method for adding child objects. - BaseCharacter now contains a copy of Game - Revised Realm.GetZone() - Revised Zone.GetRoom() - Removed Zone.RebuildRoomCollection as content is currently no longer stored using physical files. - Added GameManagement.Log for logging errors and warnings to file. Use Log.Write().
This commit is contained in:
parent
0587b4a475
commit
486efa4fed
16 changed files with 213 additions and 114 deletions
|
@ -31,6 +31,17 @@ namespace MudEngine.GameObjects.Characters
|
|||
/// </summary>
|
||||
public Boolean IsAdmin { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the currently running game.
|
||||
/// </summary>
|
||||
public Game Game { get; private set; }
|
||||
|
||||
public BaseCharacter(Game game)
|
||||
{
|
||||
Game = game;
|
||||
CurrentRoom = game.InitialRealm.InitialZone.InitialRoom;
|
||||
}
|
||||
|
||||
public virtual void OnTravel(AvailableTravelDirections travelDirection)
|
||||
{
|
||||
if (CurrentRoom.DoorwayExist(travelDirection.ToString()))
|
||||
|
@ -40,15 +51,16 @@ namespace MudEngine.GameObjects.Characters
|
|||
}
|
||||
}
|
||||
|
||||
public CommandResults ExecuteCommand(string command, BaseCharacter character, Game game, Room room)
|
||||
public CommandResults ExecuteCommand(string command)
|
||||
{
|
||||
//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.
|
||||
return CommandEngine.ExecuteCommand(command, character, game, room);
|
||||
return CommandEngine.ExecuteCommand(command, this);
|
||||
}
|
||||
|
||||
public void Initialize(ref MudEngine.Networking.ClientSocket rcs)
|
||||
{
|
||||
CurrentRoom = Game.InitialRealm.InitialZone.InitialRoom;
|
||||
sock = rcs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue