muddesigner/Mud Designer/MudEngine/GameCommands/CommandLook.cs
Scionwest_cp 5f9a707b4c Engine:
- Added Character class PlayerBasic for the lowest authorized level
 - Added Character class PlayerAdmin that will provide some additional higher level authorized commands
 - Added Character class PlayerGM that will provide high level authorized commands
 - Added Factions class for future use of factions
 - Added Class class for future use of classes
 - Added Race class for future use of Races
 - Added NPCFriendly class for future use of Friendly NPCs
 - Added NPCHostile class for future use of Monster NPCs
 - Added CommandWalk class for future walk command
 - Added CommandGMTeleport class for future GM teleporting support.
 - Added Description property to the Door class.
2010-01-22 22:47:37 -08:00

45 lines
1.3 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(door.Description);
}
}
return desc.ToString();
}
}
}