Ejemplo n.º 1
0
        public static void PrintTable()
        {
            Boat[] parkedBoats = Harbour.slots;

            var t     = new TablePrinter("Plats", "Båttyp", "Id", "Högsta Hastighet", "Vikt");
            int index = 1;

            // Print to console with tableprinter class
            foreach (var boat in parkedBoats)
            {
                if (boat != null)
                {
                    t.AddRow(index, boat.boatType, boat.Id, boat.MaxSpeed + " knop", boat.Weight + " kg");
                }
                else
                {
                    t.AddRow(index, "", "", "", "");
                }
                index++;
            }

            t.Print();
            PrintSlotInfo();
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     TablePrinter.PrintUI();
 }