Example #1
0
        /// <summary>
        /// BoardLayout深拷贝
        /// </summary>
        /// <param name="boardLayout"></param>
        public BoardLayout Clone()
        {
            BoardLayout boardLayout = new BoardLayout();

            boardLayout.LayoutName = this.LayoutName;

            foreach (ButtonDefinition buttonDef in this.BoardButtonDefs)
            {
                boardLayout.BoardButtonDefs.Add(new ButtonDefinition(buttonDef.KeyCode, buttonDef.KeyText, buttonDef.ButtonRect));
            }

            return(boardLayout);
        }
Example #2
0
        public bool Compare(BoardLayout targetLayout)
        {
            if (targetLayout.LayoutName != this.LayoutName)
            {
                return(false);
            }

            for (int i = 0; i < this.BoardButtonDefs.Count; i++)
            {
                if (!targetLayout.BoardButtonDefs[i].Compare(this.BoardButtonDefs[i]))
                {
                    return(false);
                }
            }

            return(true);
        }