示例#1
0
    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);
    }
示例#2
0
    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);
    }