public static LogicRuntimeData GetLogic(LogicType lt) { LogicRuntimeData ld = new LogicRuntimeData(); LogicMapping lm = ms_LogicMapping[(int)lt]; ld.LogicObj = lm.LogicInterface.CreateLogic(); ld.LogicUIObj = lm.LogicUIInterface.CreateLogicUI(); ld.LogicRes = lm.LogicResType; ld.Type = lt; return(ld); }
static LogicMapping NewMapping <LOGIC, UI>(LogicType logicType, ResType res) where LOGIC : ILogic, new() where UI : ILogicUI, new() { LogicMapping lm = new LogicMapping(); lm.LogicResType = res; lm.LogicInterface = new LogicFactory <LOGIC>(); lm.LogicUIInterface = new LogicUIFactory <UI>(); return(lm); }