muddesigner/MudEngine/Commands/CommandWalk.cs
Scionwest_cp a52ccf8da9 MudEngine:
- Converted all Types from C# types to .NET Types (such as bool changed to Boolean, and int changed to Int32).
 - Zone no longer gets saved from within GameWorld.Save, but rather in Realm.Save()
 - Room no longer gets saved from within GameWorld.Save(), but rather in Zone.Save();
 - Added new SaveWorld command that admins only can execute to force save the world. It's not fully implemented at this time.

MudGame:
 - began work on command execution from within the server while it's running.
2010-08-14 00:20:43 -07:00

50 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using MudEngine.GameObjects.Characters;
using MudEngine.GameManagement;
using MudEngine.GameObjects.Environment;
using MudEngine.GameObjects;
using MudEngine.FileSystem;
namespace MudEngine.Commands
{
public class CommandWalk : IGameCommand
{
public String Name { get; set; }
public Boolean Override { get; set; }
public CommandResults Execute(String command, BaseCharacter player)
{
String[] words = command.Split(' ');
List<String> directions = new List<String>();
if (words.Length == 1)
return new CommandResults("No direction supplied");
else
{
foreach (Door door in player.CurrentRoom.Doorways)
{
if (door.TravelDirection == TravelDirections.GetTravelDirectionValue(words[1]))
{
//Move the player into their new room
player.Move(door.TravelDirection);
player.CommandSystem.ExecuteCommand("Look", player);
if (player.ActiveGame.AutoSave)
player.Save(player.Filename);
return null;
}
}
}
player.Send("Unable to travel in that direction.");
return null;
}
}
}