Пример #1
0
    //--- impl

    GameState TryCompile(string name)
    {
        DestroyBoard();
        _modelinfo = new ModelInfo();
        Title      = name;
        var script = ScriptLoader.ReadScript(name);

        if (script == null)
        {
            Message = "Script not loaded";
        }
        else if (script.StartsWith("Error"))
        {
            Message = script;
        }
        else if (!_modelinfo.Compile(name, script))
        {
            Message = _modelinfo.Message;
        }
        else
        {
            Title = GameDef.GetSetting(OptionSetting.title, "unknown");
            AcceptInput("level 0");
            return(GameState.Intro);
        }
        return(GameState.Error);
    }