先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using ModuleModel;
|
|
|
|
namespace ModuleManager
|
|
{
|
|
public partial class ModuleManager :IManager
|
|
{
|
|
private Dictionary<int, IModel> _allModules = new Dictionary<int, IModel>();
|
|
|
|
private List<IModel> _updateModules = new List<IModel>();
|
|
|
|
public ModuleManager()
|
|
{
|
|
this.RegisterAllManager();
|
|
this.RegisterAllModel();
|
|
}
|
|
|
|
public void DoFrameUpdate(int time, int delta)
|
|
{
|
|
foreach (IModel mod in _updateModules)
|
|
{
|
|
mod.DoFrameUpdate(time, delta);
|
|
}
|
|
}
|
|
|
|
public async void ImportFromServer(Dictionary<string, string> userDatas)
|
|
{
|
|
foreach (IModel mod in _updateModules)
|
|
{
|
|
mod.InitServerData(userDatas);
|
|
}
|
|
|
|
await Awaiters.NextFrame;
|
|
|
|
foreach (IModel mod in _updateModules)
|
|
{
|
|
mod.AfterServerDataAnalysis();
|
|
}
|
|
}
|
|
private void RegisterMoudle(IModel module)
|
|
{
|
|
module.Init();
|
|
_updateModules.Add(module);
|
|
if (!_allModules.TryGetValue(module.ModuleId, out IModel value))
|
|
{
|
|
_allModules.Add(module.ModuleId,module);
|
|
}
|
|
}
|
|
|
|
public IModel FindModule(ModuleIdEnum moduleId)
|
|
{
|
|
IModel module = null;
|
|
_allModules.TryGetValue((int)moduleId, out module);
|
|
return module;
|
|
}
|
|
|
|
public void DisposeData()
|
|
{
|
|
foreach (IModel mod in _updateModules)
|
|
{
|
|
mod.Dispose();
|
|
}
|
|
}
|
|
}
|
|
}
|