Beispiel #1
0
        public Tube(TubeCoords tubeCoords)
        {
            this.tubeCoords = tubeCoords;

            rectanglePosition = tubeRowColToXY(tubeCoords);
            this.rectangle    = new Rectangle(this.rectanglePosition.x, this.rectanglePosition.y, this.tubeSize, this.tubeSize);
        }
Beispiel #2
0
        private RectangleCoords tubeRowColToXY(TubeCoords tubeCoords)
        {
            RectangleCoords rectangleCoords = new RectangleCoords()
            {
                x = ((int)(tubeCoords.col - 200) * tubeShift), //Ряд
                y = ((int)tubeCoords.row * tubeSize)           //Колонна
            };

            //сместили если четный ряд
            if (rectangleCoords.y % 2 != 0)
            {
                rectangleCoords.x = rectangleCoords.x + tubeShift;
            }
            return(rectangleCoords);
        }