MudEngine:
- Fixed Game looking for a class inheriting from PlayerBasic instead of BaseCharacter during Script loading. MudGame: - Added better commenting.
This commit is contained in:
parent
486efa4fed
commit
da42864a85
2 changed files with 7 additions and 3 deletions
|
@ -46,14 +46,14 @@ namespace MUDGame
|
||||||
//Create the world
|
//Create the world
|
||||||
BuildRealms();
|
BuildRealms();
|
||||||
|
|
||||||
//Start the game.
|
//Load all of the available commands from the engine
|
||||||
MudEngine.GameManagement.CommandEngine.LoadAllCommands();
|
MudEngine.GameManagement.CommandEngine.LoadAllCommands();
|
||||||
|
|
||||||
//Player must be instanced AFTER BuildRealms as it needs Game.InitialRealm.InitialZone.InitialRoom
|
//Player must be instanced AFTER BuildRealms as it needs Game.InitialRealm.InitialZone.InitialRoom
|
||||||
//property so that it can set it's starting room correctly.
|
//property so that it can set it's starting room correctly.
|
||||||
player = new MudEngine.GameObjects.Characters.BaseCharacter(game);
|
player = new MudEngine.GameObjects.Characters.BaseCharacter(game);
|
||||||
|
|
||||||
// Start the server thread.
|
// Start the game & server
|
||||||
if (!game.Start())
|
if (!game.Start())
|
||||||
Console.WriteLine("Error starting game!\nReview Log file for details.");
|
Console.WriteLine("Error starting game!\nReview Log file for details.");
|
||||||
|
|
||||||
|
@ -66,7 +66,11 @@ namespace MUDGame
|
||||||
Console.Write("Command: ");
|
Console.Write("Command: ");
|
||||||
string command = Console.ReadLine();
|
string command = Console.ReadLine();
|
||||||
|
|
||||||
|
//TODO: Does the CommandResult really need to return an array of Objects?
|
||||||
|
//All object management should be dealt with by the Game and Player so this should just be an array of strings.
|
||||||
object[] result = player.ExecuteCommand(command).Result;
|
object[] result = player.ExecuteCommand(command).Result;
|
||||||
|
|
||||||
|
//Search through each object in the array returned to us from the command execution and print the strings.
|
||||||
foreach (object o in result)
|
foreach (object o in result)
|
||||||
{
|
{
|
||||||
if (o is string)
|
if (o is string)
|
||||||
|
|
|
@ -199,7 +199,7 @@ namespace MudEngine.GameManagement
|
||||||
|
|
||||||
foreach (Type t in assem.GetTypes())
|
foreach (Type t in assem.GetTypes())
|
||||||
{
|
{
|
||||||
if (t.BaseType.Name == "PlayerBasic")
|
if (t.BaseType.Name == "BaseCharacter")
|
||||||
{
|
{
|
||||||
Scripting.GameObject obj = new Scripting.GameObject();
|
Scripting.GameObject obj = new Scripting.GameObject();
|
||||||
obj = scriptEngine.GetObject(t.Name);
|
obj = scriptEngine.GetObject(t.Name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue