コード例 #1
0
ファイル: InitialCell.cs プロジェクト: anton31kah/flow
        public override void Draw(Graphics formGraphics)
        {
            Pipes.Graphics = formGraphics;
            Pipes.Big(Point.X, Point.Y, Width, Height, Color);

            if (PipeDirection.Any())
            {
                switch (PipeDirection.Peek())
                {
                case flow.PipeDirection.Medium:
                    Pipes.Medium(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Up:
                    Pipes.Up(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Down:
                    Pipes.Down(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Left:
                    Pipes.Left(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Right:
                    Pipes.Right(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                default:

                    throw new ArgumentOutOfRangeException();
                }
            }
        }
コード例 #2
0
ファイル: NormalCell.cs プロジェクト: anton31kah/flow
        public override void Draw(Graphics formGraphics)
        {
            Pipes.Graphics = formGraphics;
            Pipes.Border(Point.X, Point.Y, Width, Height);

            foreach (PipeDirection pipeDirection in PipeDirection)
            {
                switch (pipeDirection)
                {
                case flow.PipeDirection.Medium:
                    Pipes.Medium(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Up:
                    Pipes.Up(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Down:
                    Pipes.Down(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Left:
                    Pipes.Left(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.Right:
                    Pipes.Right(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.UpLeft:
                    Pipes.UpLeft(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.UpRight:
                    Pipes.UpRight(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.DownLeft:
                    Pipes.DownLeft(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.DownRight:
                    Pipes.DownRight(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.UpDown:
                    Pipes.UpDown(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                case flow.PipeDirection.LeftRight:
                    Pipes.LeftRight(Point.X, Point.Y, Width, Height, Color);
                    NumberOfPipes++;

                    break;

                default:

                    throw new ArgumentOutOfRangeException();
                }
            }
        }