MudCompiler: No longer works. Needs to be re-wrote to support the new Alpha 2.0 engine MudDesigenr: Removed most of the forms since we are not working on it. Only form left is Project Manager, which will be removed shortly as well. MudGame: No longer runs. All of the source code was removed due to MudEngine Alpha 2.0 source changing drastically. MudEngine: Alpha 2.0 source code finally checked-in. It contains the full re-build of the engine. A lot of new abstract classes have been added.
67 lines
No EOL
2.5 KiB
C#
67 lines
No EOL
2.5 KiB
C#
using System;
|
|
|
|
namespace MudEngine.World
|
|
{
|
|
[System.Flags]
|
|
public enum AvailableTravelDirections : uint
|
|
{
|
|
None = 0,
|
|
North = 1,
|
|
South = 2,
|
|
East = 4,
|
|
West = 8,
|
|
Up = 16,
|
|
Down = 32,
|
|
Northeast = North | East,
|
|
Northwest = North | West,
|
|
Southeast = South | East,
|
|
Southwest = South | West
|
|
}
|
|
|
|
public static class TravelDirections
|
|
{
|
|
public static AvailableTravelDirections GetReverseDirection(AvailableTravelDirections Direction)
|
|
{
|
|
switch (Direction)
|
|
{
|
|
case AvailableTravelDirections.North:
|
|
return AvailableTravelDirections.South;
|
|
case AvailableTravelDirections.South:
|
|
return AvailableTravelDirections.North;
|
|
case AvailableTravelDirections.East:
|
|
return AvailableTravelDirections.West;
|
|
case AvailableTravelDirections.West:
|
|
return AvailableTravelDirections.East;
|
|
case AvailableTravelDirections.Up:
|
|
return AvailableTravelDirections.Down;
|
|
case AvailableTravelDirections.Down:
|
|
return AvailableTravelDirections.Up;
|
|
case AvailableTravelDirections.Northeast:
|
|
return AvailableTravelDirections.Southwest;
|
|
case AvailableTravelDirections.Southwest:
|
|
return AvailableTravelDirections.Northeast;
|
|
case AvailableTravelDirections.Northwest:
|
|
return AvailableTravelDirections.Southeast;
|
|
case AvailableTravelDirections.Southeast:
|
|
return AvailableTravelDirections.Northwest;
|
|
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;
|
|
}
|
|
}
|
|
} |