Ejemplo n.º 1
0
        internal EditableScriptBase CreateEditableScript(IScript script)
        {
            EditableScriptBase newScript;

            if (m_cache.TryGetValue(script, out newScript))
            {
                return(newScript);
            }

            if (script.Keyword == "if")
            {
                newScript = new EditableIfScript(m_controller, (IIfScript)script, m_worldModel.UndoLogger);
            }
            else
            {
                EditableScript newEditableScript = new EditableScript(m_controller, script, m_worldModel.UndoLogger);
                if (m_scriptData.ContainsKey(script.Keyword))
                {
                    newEditableScript.DisplayTemplate = m_scriptData[script.Keyword].DisplayString;
                }
                newScript = newEditableScript;
            }
            m_cache.Add(script, newScript);
            return(newScript);
        }
Ejemplo n.º 2
0
 internal EditableElseIf(IElseIfScript elseIfScript, EditableIfScript parent)
 {
     m_elseIfScript = elseIfScript;
     m_parent = parent;
     EditableScripts = TextAdventures.Quest.EditableScripts.GetInstance(parent.Controller, elseIfScript.Script);
 }
Ejemplo n.º 3
0
        internal EditableScriptBase CreateEditableScript(IScript script)
        {
            EditableScriptBase newScript;

            if (m_cache.TryGetValue(script, out newScript))
            {
                return newScript;
            }

            if (script.Keyword == "if")
            {
                newScript = new EditableIfScript(m_controller, (IIfScript)script, m_worldModel.UndoLogger);
            }
            else
            {
                EditableScript newEditableScript = new EditableScript(m_controller, script, m_worldModel.UndoLogger);
                if (m_scriptData.ContainsKey(script.Keyword)) newEditableScript.DisplayTemplate = m_scriptData[script.Keyword].DisplayString;
                newScript = newEditableScript;
            }
            m_cache.Add(script, newScript);
            return newScript;
        }
Ejemplo n.º 4
0
 internal EditableElseIf(IElseIfScript elseIfScript, EditableIfScript parent)
 {
     m_elseIfScript  = elseIfScript;
     m_parent        = parent;
     EditableScripts = TextAdventures.Quest.EditableScripts.GetInstance(parent.Controller, elseIfScript.Script);
 }