- Added Look and Walk Commands, however they are not fully implemented. - Corrected Networking classes having a public de-constructor. These must be private or the compiler fails. - Corrected Networking classes using an incorrect 'using' statement. You cannot reference classes in the statement, must only reference the namespace itself (i.e. using MUDEngine.Networking). - Removed using statement for Networking in the Networking classes as all classes created within that namespace automatically are within the same scope.
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using MudEngine.GameObjects.Characters;
|
|
using MudEngine.GameObjects.Characters.Controlled;
|
|
using MudEngine.FileSystem;
|
|
using MudEngine.Commands;
|
|
using MudEngine.GameManagement;
|
|
using MudEngine.GameObjects.Environment;
|
|
using MudEngine.GameObjects.Items;
|
|
|
|
namespace MudEngine.Commands
|
|
{
|
|
public class CommandLook : IGameCommand
|
|
{
|
|
public string Name { get; set; }
|
|
public bool Override { get; set; }
|
|
|
|
public CommandResults Execute(string command, BaseCharacter player, Game project, Room room)
|
|
{
|
|
StringBuilder desc = new StringBuilder();
|
|
|
|
if (room == null)
|
|
{
|
|
return new CommandResults("Not within a created Room.");
|
|
}
|
|
|
|
desc.AppendLine(room.Description);
|
|
foreach (Door door in room.Doorways)
|
|
{
|
|
if (door.TravelDirection != MudEngine.GameObjects.AvailableTravelDirections.Down && door.TravelDirection != MudEngine.GameObjects.AvailableTravelDirections.Up)
|
|
{
|
|
desc.AppendLine(door.Description);
|
|
}
|
|
}
|
|
|
|
return new CommandResults(desc.ToString());
|
|
}
|
|
}
|
|
}
|