Deleted Networking folder.
Deleted ParseProperty Attribute. A different approach will be used for dynamic Type saving. Removed BaseObject.NewSave(). The re-write on save code will be done at a later date.
This commit is contained in:
parent
373b8b66b8
commit
c432edbef9
5 changed files with 1 additions and 65 deletions
|
@ -1,23 +0,0 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.ComponentModel;
|
||||
namespace MudEngine.Attributes
|
||||
{
|
||||
[System.AttributeUsage(System.AttributeTargets.Property)]
|
||||
public class ParseProperty
|
||||
: System.Attribute
|
||||
{
|
||||
Object obj;
|
||||
|
||||
public ParseProperty(Object var)
|
||||
{
|
||||
obj = var;
|
||||
}
|
||||
|
||||
public object GetObject()
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -178,43 +178,6 @@ namespace MudEngine.GameObjects
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void NewSave()
|
||||
{
|
||||
ScriptObject obj = new ScriptObject(this);
|
||||
PropertyInfo[] prop = this.GetType().GetProperties();
|
||||
|
||||
string path = this.SavePath;
|
||||
|
||||
if (String.IsNullOrEmpty(path))
|
||||
return;
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
string filename = Path.Combine(path, Filename);
|
||||
|
||||
if (File.Exists(filename))
|
||||
File.Delete(filename);
|
||||
|
||||
foreach (var p in prop)
|
||||
{
|
||||
object[] attributes = p.GetCustomAttributes(typeof(MudEngine.Attributes.ParseProperty), false);
|
||||
|
||||
foreach (Attribute a in attributes)
|
||||
{
|
||||
if (a.GetType().Name == "ParseProperty")
|
||||
{
|
||||
ParseProperty(p);
|
||||
}
|
||||
}
|
||||
FileManager.WriteLine(filename, obj.GetProperty(p.Name).ToString(), p.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseProperty(PropertyInfo propety)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Save()
|
||||
{
|
||||
string path = this.SavePath;
|
||||
|
|
|
@ -6,7 +6,6 @@ using System.Text;
|
|||
using System.IO;
|
||||
|
||||
//MUD Engine
|
||||
using MudEngine.Attributes;
|
||||
using MudEngine.FileSystem;
|
||||
using MudEngine.Commands;
|
||||
using MudEngine.GameManagement;
|
||||
|
@ -40,7 +39,6 @@ namespace MudEngine.GameObjects.Characters
|
|||
/// <summary>
|
||||
/// The current Room this Character is located at.
|
||||
/// </summary>
|
||||
[ParseProperty(typeof(Room))]
|
||||
public Room CurrentRoom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -54,8 +54,7 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Core\ParseProperty.cs" />
|
||||
<Compile Include="Commands\BaseCommand.cs" />
|
||||
<Compile Include="Core\BaseCommand.cs" />
|
||||
<Compile Include="Commands\CommandRestart.cs" />
|
||||
<Compile Include="Commands\CommandLogin.cs" />
|
||||
<Compile Include="Commands\CommandSaveWorld.cs" />
|
||||
|
@ -98,7 +97,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Networking\" />
|
||||
<Folder Include="Objects\" />
|
||||
<Folder Include="World\" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue