Exemplo n.º 1
0
        private void DrawDoraTile(int Index, int Y, int Tile)
        {
            int X = PaddingH + Index * TileWidth + TileWidth / 2;

            Bitmap TileBitmap = new PaifuTileImage(Tile, Scale, Red).Bmp;

            G.DrawImage(TileBitmap, new Point(X, Y));
        }
Exemplo n.º 2
0
        private void DrawDiscardTile(int Index, int Tile, string Comment, bool Danger, bool Furiten, int Shanten)
        {
            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + (Column) * TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * 3);

            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);
            if (Danger && (ShowDanger != 0))
                TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            G.DrawImage(TileBitmap, new Point(X, Y));
            DrawCenteredString(Color.Black, Fcomment, Comment, new PointF(X, Y + TileHeight), TileWidth);

            if (ShowShanten != 0)
            {
                if (Furiten)
                {
                    Brush Gray = new SolidBrush(Color.FromArgb(200, Color.Black));

                    G.FillRectangle(Gray, X, Y + TileBitmap.Height, TileBitmap.Width, TileBitmap.Height / 10);
                }
                else if ((Shanten >= 0) && (Shanten < ShantenColor.Length))
                {
                    if (ShowColor != 0)
                    {
                        Brush BrColor = new SolidBrush(ShantenColor[Shanten]);

                        G.FillRectangle(BrColor, X, Y + TileBitmap.Height, TileBitmap.Width, TileBitmap.Height / 10);
                    }
                    if ((Comment.CompareTo("") == 0) && (Shanten > 0)) DrawCenteredString(Color.Black, Fcomment, Shanten.ToString(), new PointF(X, Y + TileHeight), TileWidth);
                }
            }
        }
Exemplo n.º 3
0
        private int DrawHandTile(int Index, int Tile, int Pos, int Line, int YOffset, RotateFlipType Rotate, bool Danger)
        {
            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);
            if (Danger && (ShowDanger != 0))
                TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            switch (Rotate)
            {
                case RotateFlipType.Rotate90FlipNone: TileBitmap.RotateFlip(Rotate); break;
                case RotateFlipType.Rotate270FlipNone: TileBitmap.RotateFlip(Rotate); break;
            }

            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + Pos + TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * Line) + YOffset + TileHeight - TileBitmap.Height;

            G.DrawImage(TileBitmap, new Point(X, Y));

            return Pos + TileBitmap.Width;
        }
Exemplo n.º 4
0
        private void DrawTsumoTile(int Index, int Tile, string Comment, bool Tsumogiri, bool Danger)
        {
            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + (Column) * TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * 2);

            if (Tsumogiri) Tile = -2;

            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);

            if (Danger && !Tsumogiri && (ShowDanger != 0)) TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            G.DrawImage(TileBitmap, new Point(X, Y));

            DrawCenteredString(Color.Black, Fcomment, Comment, new PointF(X, Y - G.MeasureString(Comment, Fcomment).Height), TileWidth);
        }
Exemplo n.º 5
0
        private void CalcTileDimensions()
        {
            PaifuTileImage Img = new PaifuTileImage(-1, Scale, Red);

            TileWidth = Img.Bmp.Width;
            TileHeight = Img.Bmp.Height;

            int CircleCount = 23;
            {
                int StepCount = 12;

                for (int i = 0; i < Rnd.PlayerCount; i++) if (Rnd.StepCount[i] > StepCount) StepCount = Rnd.StepCount[i];

                CircleCount = StepCount + 4;
            }

            TilesColumnWidth = TileWidth * CircleCount;

            TilesColumnWidth += (ShowYakuInfo != 0) ? YakuWidth : NoYakuWidth;

            Width = RoundColumnWidth + PlayerColumnWidth + TilesColumnWidth + PaddingH * 2;
            Height = 2 * PaddingV + R.PlayerCount * (2 * InternalPadding + 6 * TileHeight);

            InternalWidth = Width - 2 * PaddingH;
            InternalHeight = Height - 2 * PaddingV;

            RoundColumnWidth = TileWidth * 5;

            FieldHeight = InternalHeight / R.PlayerCount;
        }