Engine:
- 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)
This commit is contained in:
parent
7c72fbb2e8
commit
85aae88e34
6 changed files with 91 additions and 3 deletions
48
Mud Designer/MudEngine/GameCommands/CommandLook.cs
Normal file
48
Mud Designer/MudEngine/GameCommands/CommandLook.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue