コード例 #1
0
ファイル: Program.cs プロジェクト: NikitaDocent/bynaryTree
        static void Main(string[] args)
        {
            Rectangle rec1 = new Rectangle(10, 10, "Yellow", "Blue");
            Rectangle rec2 = new Rectangle(11, 30, "Yellow", "Blue");
            RectangleList <Rectangle> rectangles  = new RectangleList <Rectangle>();
            BinaryTree <Rectangle>    rectangles1 = new BinaryTree <Rectangle>();

            rectangles.Add(rec1);
            rectangles1.Add(rec1);
            rectangles.Add(rec2);
            rectangles1.Add(rec2);
        }
コード例 #2
0
        private void InitYangYaoInfo(PointF startPoint, int totalWidth, int heigth, int midWidth = 0)
        {
            Yang    = new Yang();
            YaoEr   = "0";
            YaoName = Yang.Name + YaoName;
            var size = new Size(totalWidth, heigth);

            Rectangle = new RectangleF(startPoint, size);
            if (RectangleList == null)
            {
                RectangleList = new List <RectangleF>();
            }
            RectangleList.Add(Rectangle);
        }
コード例 #3
0
ファイル: JsonTools.cs プロジェクト: Sinnaj94/csharp-games
        public List <IntRect> GetAnimation(Texture texture)
        {
            //TODO: Outsourcing
            //Go through Columns (Y)
            if (startColumn == endColumn)
            {
                for (int r = startRow; r <= endRow; r++)
                {
                    RectangleList.Add(GetRect(r, startColumn, texture));
                }
            }
            else
            {
                for (int c = startColumn; c < sheetSize.Y; c++)
                {
                    //Go thorugh Y
                    for (int r = 0; r < sheetSize.X; r++)
                    {
                        if (c == startColumn)
                        {
                            if (r >= startRow)
                            {
                                RectangleList.Add(GetRect(r, c, texture));
                            }
                        }
                        else if (c == endColumn)
                        {
                            if (r <= endRow)
                            {
                                RectangleList.Add(GetRect(r, c, texture));
                            }
                        }
                        else if (c > startColumn && c < endColumn)
                        {
                            RectangleList.Add(GetRect(r, c, texture));
                        }
                    }
                }
            }

            size = RectangleList.Count;
            return(RectangleList);
        }