- Zones can not be instanced without providing the owning realm in its constructor. - Started adding tooltips to the editors. - Zone Builder now checks if a Realm has been loaded yet or not prior to creating Zones. - Zone Builder will not allow Rooms to be created within new Zones until the Zone has been saved. - Zone Builder checks if a New Zone has not been saved yet prior to creating another New Zone - Renamed Room.ParentZone to Room.Zone to be consistent with the Realm and Zone classes.
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
using System.ComponentModel;
|
|
|
|
using MudDesigner.MudEngine.FileSystem;
|
|
using MudDesigner.MudEngine.GameObjects;
|
|
|
|
namespace MudDesigner.MudEngine.GameObjects.Environment
|
|
{
|
|
public class Realm : BaseObject
|
|
{
|
|
[Browsable(false)]
|
|
public List<string> Zones { get; set; }
|
|
|
|
public Realm()
|
|
{
|
|
Zones = new List<string>();
|
|
}
|
|
|
|
public Zone GetZone(string ZoneName)
|
|
{
|
|
//correct the zonename if needed
|
|
if (!ZoneName.EndsWith(".zone"))
|
|
ZoneName += ".zone";
|
|
|
|
//build our path
|
|
string realmPath = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), this.Name);
|
|
|
|
//get a collection of all the zones within the realm
|
|
string[] files = Directory.GetFiles(realmPath, "*.zone");
|
|
Zone zone = new Zone(this);
|
|
|
|
//look four our zone file
|
|
foreach (string file in files)
|
|
{
|
|
if (file == ZoneName)
|
|
{
|
|
string zonePath = Path.Combine(realmPath, Path.GetDirectoryName(file));
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|