- Added GameCommands namespace for holding all of the game command classes - Added ICommand interface for game commands. - Added IPlayer interface for player classes. - Added CommandLook for prepping the Test Runtime for looking at environments. Misc: - Updated Mud Designer Project Roadmap file (MudDesigner.pod)
48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using MudDesigner.MudEngine.FileSystem;
|
|
using MudDesigner.MudEngine.GameCommands;
|
|
using MudDesigner.MudEngine.GameManagement;
|
|
using MudDesigner.MudEngine.GameObjects.Environment;
|
|
using MudDesigner.MudEngine.GameObjects.Items;
|
|
using MudDesigner.MudEngine.Interfaces;
|
|
|
|
namespace MudDesigner.MudEngine.GameCommands
|
|
{
|
|
public class CommandLook : IGameCommand
|
|
{
|
|
public string Name { get; set; }
|
|
public bool Override { get; set; }
|
|
|
|
public object Execute(params object[] parameters)
|
|
{
|
|
Room room = new Room() ;
|
|
StringBuilder desc = new StringBuilder();
|
|
|
|
foreach (object obj in parameters)
|
|
{
|
|
if (obj is Room)
|
|
room = (Room)obj;
|
|
}
|
|
|
|
if (room == null)
|
|
return null;
|
|
|
|
foreach (Door door in room.Doorways)
|
|
{
|
|
if (door.TravelDirection != MudDesigner.MudEngine.GameObjects.AvailableTravelDirections.Down && door.TravelDirection != MudDesigner.MudEngine.GameObjects.AvailableTravelDirections.Up)
|
|
{
|
|
desc.AppendLine("To the ");
|
|
desc.Append(door.TravelDirection.ToString());
|
|
desc.Append(" is ");
|
|
desc.Append(door.ConnectedRoom);
|
|
}
|
|
}
|
|
|
|
return desc.ToString();
|
|
}
|
|
}
|
|
}
|