コード例 #1
0
 public ResultTableWriter(ILang lang)
 {
     Lang         = lang;
     ColumnWidths = new int[] {
         Math.Max(Lang.Total().Length, Lang.Taken().Length),
         Math.Max(Lang.Weight().Length, 2),
         Math.Max(Lang.Value().Length, 2),
         Math.Max(Lang.DoTake().Length, TAKE_FLAG.Length)
     };
 }
コード例 #2
0
        public void WriteHeader()
        {
            string headerContent(int colIndex, int colWidth)
            {
                // "|       | Weight | Value | Take? |"
                switch (colIndex)
                {
                case 1:  return(Lang.Weight());

                case 2:  return(Lang.Value());

                case 3:  return(Lang.DoTake());

                default: return(null);
                }
            }

            Console.WriteLine(HorizontalLine());
            Console.WriteLine(TableRow(headerContent));
            Console.WriteLine(HorizontalLine());
        }