- Corrected SaveDataTypes.Currency being named incorrectly. Changed to Currencies - ProjectInformation now inherits from the new IFileIO interface. - ProjectInformation.Load can be used instead of the FileManager now (note: Saving of ProjectInformation must still be done using FileManager) - Organizing of BaseObject done - BaseObject now supports BaseObject.Load. Use this instead of FileManager.Load - Fixed UIRealmControl error, attempting to deserialize into a null Zone Field - Program.cs is now encapsulated into a try/catch - IFileIO interface added for providing a blueprint on file I/O operations Designer: - Additional ObjectTypes added to the ObjectTypes enum - Additional commenting provided throughout the source. - Re-organized the source code. - Simplified the Constructor code. Roughly 50% less code now. - Re-wrote the Object Load code to make it easier to read and maintain. - Renamed several menu items to conform to the projects naming conventions
56 lines
No EOL
1.9 KiB
C#
56 lines
No EOL
1.9 KiB
C#
using System;
|
|
|
|
namespace MudDesigner.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 (int value in values)
|
|
{
|
|
string displayName = Enum.GetName(typeof(AvailableTravelDirections), value);
|
|
|
|
if (displayName == Direction)
|
|
return (AvailableTravelDirections)Enum.Parse(typeof(AvailableTravelDirections), displayName);
|
|
}
|
|
|
|
return AvailableTravelDirections.None;
|
|
}
|
|
}
|
|
} |