CSLE.CLS_Environment.GetTypeByKeywordQuiet C# (CSharp) Method

GetTypeByKeywordQuiet() public method

public GetTypeByKeywordQuiet ( string keyword ) : ICLS_Type
keyword string
return ICLS_Type
        public ICLS_Type GetTypeByKeywordQuiet(string keyword)
        {
            ICLS_Type ret = null;
            if (typess.TryGetValue(keyword, out ret) == false)
            {
                return null;
            }
            return ret;
        }
        public void RegFunction(ICLS_Function func)

Usage Example

Ejemplo n.º 1
0
        public ScreenController(string name, IGameForModel game, IScreenForModel screen)
        {
            this.game   = game;
            this.screen = screen;


            IScriptModel script = game.GetModel("script") as IScriptModel;

            env = script.getScriptEnv();
            var type = env.GetTypeByKeywordQuiet(name) as CSLE.CLS_Type_Class;

            content    = new CSLE.CLS_Content(env);
            scriptThis = type.function.New(content, null).value as CSLE.SInstance;
            scriptThis.member["game"]         = new CSLE.CLS_Content.Value();
            scriptThis.member["game"].value   = game;
            scriptThis.member["game"].type    = typeof(IGameForModel);
            scriptThis.member["screen"]       = new CSLE.CLS_Content.Value();
            scriptThis.member["screen"].value = screen;
            scriptThis.member["screen"].type  = typeof(IScreenForModel);


            var typeasync = env.GetTypeByKeywordQuiet("IScreenControllerAsync") as CSLE.CLS_Type_Class;

            try
            {
                havetypeasync = (type.ConvertTo(content, scriptThis, typeasync.type) != null);
            }
            catch
            {
                havetypeasync = false;
            }
            Debug.Log(havetypeasync);
        }
All Usage Examples Of CSLE.CLS_Environment::GetTypeByKeywordQuiet