- 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.
57 lines
No EOL
1.9 KiB
C#
57 lines
No EOL
1.9 KiB
C#
//Microsoft .NET Framework
|
|
using System;
|
|
|
|
namespace MudEngine.GameObjects
|
|
{
|
|
public enum AvailableTravelDirections
|
|
{
|
|
None = 0,
|
|
North,
|
|
South,
|
|
East,
|
|
West,
|
|
Up,
|
|
Down,
|
|
}
|
|
|
|
public static class TravelDirections
|
|
{
|
|
public static AvailableTravelDirections GetReverseDirection(AvailableTravelDirections Direction)
|
|
{
|
|
switch (Direction)
|
|
{
|
|
case AvailableTravelDirections.Down:
|
|
return AvailableTravelDirections.Up;
|
|
case AvailableTravelDirections.East:
|
|
return AvailableTravelDirections.West;
|
|
case AvailableTravelDirections.None:
|
|
return AvailableTravelDirections.None;
|
|
case AvailableTravelDirections.North:
|
|
return AvailableTravelDirections.South;
|
|
case AvailableTravelDirections.South:
|
|
return AvailableTravelDirections.North;
|
|
case AvailableTravelDirections.Up:
|
|
return AvailableTravelDirections.Down;
|
|
case AvailableTravelDirections.West:
|
|
return AvailableTravelDirections.East;
|
|
default:
|
|
return AvailableTravelDirections.None;
|
|
}
|
|
}
|
|
|
|
public static AvailableTravelDirections GetTravelDirectionValue(String Direction)
|
|
{
|
|
Array values = Enum.GetValues(typeof(AvailableTravelDirections));
|
|
|
|
foreach (Int32 value in values)
|
|
{
|
|
String displayName = Enum.GetName(typeof(AvailableTravelDirections), value);
|
|
|
|
if (displayName.ToLower() == Direction.ToLower())
|
|
return (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), displayName);
|
|
}
|
|
|
|
return AvailableTravelDirections.None;
|
|
}
|
|
}
|
|
} |