Пример #1
0
        internal EditableIfScript(EditorController controller, IfScript script, UndoLogger undoLogger)
            : base(controller, script, undoLogger)
        {
            m_ifScript = script;

            m_ifScript.IfScriptUpdated += m_ifScript_IfScriptUpdated;

            if (m_ifScript.ThenScript == null)
            {
                m_ifScript.ThenScript = new MultiScript();
            }

            m_thenScript = EditableScripts.GetInstance(Controller, m_ifScript.ThenScript);
            m_thenScript.Updated += nestedScript_Updated;

            foreach (var elseIfScript in m_ifScript.ElseIfScripts)
            {
                EditableElseIf newEditableElseIf = new EditableElseIf(elseIfScript, this);
                m_elseIfScripts.Add(elseIfScript.Script, newEditableElseIf);
                newEditableElseIf.EditableScripts.Updated += nestedScript_Updated;
            }

            if (m_ifScript.ElseScript != null)
            {
                m_elseScript = EditableScripts.GetInstance(Controller, m_ifScript.ElseScript);
                m_elseScript.Updated += nestedScript_Updated;
            }
        }
Пример #2
0
 public EditableScriptBase(EditorController controller, IScript script, UndoLogger undoLogger)
 {
     Script = script;
     m_controller = controller;
     if (script != null)
     {
         ((IMutableField)script).UndoLog = undoLogger;
     }
 }
Пример #3
0
 internal EditableScript(EditorController controller, IScript script, UndoLogger undoLogger)
     : base(controller, script, undoLogger)
 {
     m_editorName = Script.Keyword;
 }
Пример #4
0
        public WorldModel(string filename, string originalFilename)
        {
            m_expressionOwner = new Functions.ExpressionOwner(this);
            m_template = new Template(this);
            InitialiseElementFactories();
            m_objectFactory = (ObjectFactory)m_elementFactories[ElementType.Object];

            InitialiseDebuggerObjectTypes();
            m_filename = filename;
            m_originalFilename = originalFilename;
            m_elements = new Elements();
            m_undoLogger = new UndoLogger(this);
            m_saver = new GameSaver(this);
            m_game = ObjectFactory.CreateObject("game", ObjectType.Game);
        }