Module stuff

This commit is contained in:
Marc Hernandez 2013-11-24 22:04:55 -08:00
parent 049a604fd2
commit 335ca7e368
3 changed files with 95 additions and 0 deletions

View File

@ -66,6 +66,7 @@
<Compile Include="Config.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="Log.cs" />
<Compile Include="mod\Modules.cs" />
<Compile Include="NetMsg.cs" />
<Compile Include="Pos.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

87
mod/Modules.cs Normal file
View File

@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.Diagnostics;
using System.Reflection;
namespace mod
{
[Serializable]
public class Config : lib.Config
{
public String name = "Generic";
}
public class View
{
}
public class Base
{
public Config Cfg { get { return m_cfg; } }
public Base( Config cfg )
{
m_cfg = cfg;
}
private Config m_cfg;
}
[Serializable]
public class FluidConfig : Config
{
public String type = "none";
}
public class FluidBase : Base
{
public new FluidConfig Cfg { get { return (FluidConfig)base.Cfg; } }
public FluidBase( FluidConfig cfg )
: base( cfg )
{
}
}
[Serializable]
public class SystemConfig : Config
{
public String type = "none";
}
public class System
{
public SystemConfig Cfg { get { return m_cfg; } }
public System( SystemConfig cfg )
{
m_cfg = cfg;
}
private SystemConfig m_cfg;
}
}

View File

@ -102,6 +102,7 @@ public class Mgr
Resource.mgr.m_loaders[ typeof( T ) ] = loader;
}
//Register all subclasses of a particular type
static public void registerSub<T>( Load loaderOfType )
{
@ -156,6 +157,12 @@ public class Mgr
return new Ref<object>( filename );
}
private Mgr()
{
}
private Dictionary<Type, Load> m_loaders = new Dictionary<Type, Load>();
//private Dictionary<Type, LoadType> m_loadersOfType = new Dictionary<Type, LoadType>();
}