示例#1
0
        /// <summary>
        /// Tworzy table MatchScoreTable
        /// </summary>
        /// <param name="PO">Lista rozdan z pokoju jednego</param>
        /// <param name="PZ">Lista rozdan z pokoju drugiego</param>
        /// <returns>Cała wypełniona tabela</returns>
        protected virtual Table MakeMatchScoreTable(List <Board> PO, List <Board> PZ)
        {
            Table table = new Table();


            foreach (double d in wyniki_szerokosc_kolum)
            {
                table.AddColumn(Unit.FromCentimeter(d));
            }

            MakeTableRow1(ref table, PO[0].players, PZ[0].players);
            MakeTableRow2(ref table, napisOpisStolu1, napisOpisStolu2, PO[0].players, PZ[0].players);
            MakeTableRow3(ref table);

            for (int i = 0; i < PO.Count; i++)
            {
                MakeTableRowBoard(ref table, PO[i], PZ[i], i + 1);
            }
            int[] imps = BridgeInfo.wylicz_mecz(ref PO, ref PZ);
            JoinLineIMP(ref table, imps[0], imps[1]);
            double vpNS = BridgeInfo.wylicz_vp((imps[0] - imps[1]), PO.Count);

            JoinLineVP(ref table, vpNS);


            ScoreMatchTableProperties(ref table);
            return(table);
        }
示例#2
0
        public Document Print()
        {
            document = new Document();
            document.AddSection();
            // Ustawienia
            napisTytulowy = vugraph.title.title;
            date          = game.date;
            document.LastSection.PageSetup = SetMargin();
            document.LastSection.Headers.Primary.Add(SetHeader());
            document.LastSection.Footers.Primary.Add(SetFooter());

            //strona 1
            Paragraph FirstPageTitle = new Paragraph();

            rezultatMeczuVu += vugraph.title.team1 + " - " + vugraph.title.team2;
            int[] wynikMeczu = BridgeInfo.wylicz_mecz(ref vugraph.boards, ref vugraph.boards_closed);
            rezultatMeczuVu += " " + wynikMeczu[0].ToString() + ":" + wynikMeczu[1].ToString();
            FirstPageTitle.AddFormattedText(rezultatMeczuVu, Czcionki.font_header);
            FirstPageTitle.AddLineBreak();
            FirstPageTitle.AddLineBreak();
            document.LastSection.Add(FirstPageTitle);
            FirstPageTitle = new Paragraph();
            FirstPageTitle.AddFormattedText(napisPorownania, Czcionki.font_normal);
            FirstPageTitle.AddLineBreak();
            FirstPageTitle.AddLineBreak();
            document.LastSection.Add(FirstPageTitle);

            Paragraph TabelaTitle = new Paragraph();

            TabelaTitle.AddFormattedText(
                napisMecz + "nr 1 : " + PrepareTableTitle(game.boards[0].players, vugraph.boards[0].players),
                Czcionki.font_red);
            TabelaTitle.AddLineBreak();
            TabelaTitle.AddLineBreak();
            document.LastSection.Add(TabelaTitle);

            document.LastSection.Add(MakeMatchScoreTable(game.boards, vugraph.boards));

            //strona 2
            document.AddSection();
            TabelaTitle = new Paragraph();
            TabelaTitle.AddFormattedText(
                napisMecz + "nr 2 : " + PrepareTableTitle(game.boards[0].players, vugraph.boards_closed[0].players),
                Czcionki.font_red);
            TabelaTitle.AddLineBreak();
            TabelaTitle.AddLineBreak();
            document.LastSection.Add(TabelaTitle);

            document.LastSection.Add(MakeMatchScoreTable(game.boards, vugraph.boards_closed));

            // strony z rozdaniami
            licytacja_szerokosc_kolumny = 1.375;
            for (int i = 0; i < game.boards.Count; i++)
            {
                document.AddSection();
                PrintBoards(i);
            }
            //document.LastSection.Add(PrintBoardRozklad(main.boards[0].rozklad, 1, vulnerabilties.none));

            //Paragraph p = new Paragraph();
            //p.AddFormattedText("Liczba lew do wziecia", Czcionki.font_normal);
            //document.LastSection.Add(p);



            //string[] a = {"a","b","c","d","E"};
            //p = new Paragraph();
            //p.AddFormattedText("LICYTACJA", Czcionki.font_header);
            //document.LastSection.Add(p);
            //document.LastSection.Add(PrintBiddingTable(main.boards[0].bidding,positions.N,a));

            //document.LastSection.Add(AddCommentLines());


            return(document);
        }