示例#1
0
        }   // end of Copy()

        /// <summary>
        /// Paste the contents of the cut/paste buffer into the brain.
        /// </summary>
        public void Paste()
        {
            // Anything there?
            if (ReflexPanel.CutPasteBuffer == null || ReflexPanel.CutPasteBuffer.Count == 0)
            {
                return;
            }

            // We want to paste the reflexs bottom up into the current position.  This
            // moves the current reflex and any subsequent ones down.

            Editor      editor = InGame.inGame.Editor;
            ReflexPanel panel  = editor.ActivePanel;

            for (int i = ReflexPanel.CutPasteBuffer.Count - 1; i >= 0; i--)
            {
                panel.InsertReflex();

                // The newly inserted panel should have become the active one.
                panel = editor.ActivePanel;

                // Paste the cut/paste code into this new panel and tell it to rebuild.
                panel.Reflex.Paste(ReflexPanel.CutPasteBuffer[i]);
                panel.AnimatePanelIndent(true);
                panel.uiRebuild = true;
            }

            // Update block with info from cut/paste buffer.
            Size           = ReflexPanel.CutPasteBuffer.Count;
            OriginalIndent = ReflexPanel.CutPasteBuffer[0].Indentation;

            // Ensure indent is correct.
            ValidateIndent();
        }   // end of Paste()
示例#2
0
            public override void Update()
            {
                // Update the parent's list of objects.
                for (int i = 0; i < updateList.Count; i++)
                {
                    UpdateObject obj = updateList[i] as UpdateObject;
                    Debug.Assert(obj != null);
                    obj.Update();
                }

                // Ensure this reflex is at the correct indent position.
                parent.AnimatePanelIndent(false);
            }