コード例 #1
0
            internal static void Yes()
            {
                while (true)
                {
                    TradeACC.Prints();
                    TradeACC.DrawingItems();

                    int MaxLength = 0;
                    if (TradeACC.Vendor.Inventory.Count >= Character.inventory.Count)
                    {
                        MaxLength = TradeACC.Vendor.Inventory.Count;
                    }
                    else
                    {
                        MaxLength = Character.inventory.Count;  // << unlikely
                    }
                    EOA.WriteAt("[Enter] Trade Item", 0, MaxLength + 4);
                    EOA.WriteAt("[Arrow Keys] Select Items", 0, MaxLength + 5);
                    EOA.WriteAt("[X] Exit Menu", 0, MaxLength + 6);

                    bool exit = false;
                    switch (Console.ReadKey().Key)
                    {
                    case ConsoleKey.Enter:
                        TradeACC.Trade();
                        break;

                    case ConsoleKey.UpArrow:
                        break;

                    case ConsoleKey.DownArrow:
                        TradeACC.Down();
                        break;

                    case ConsoleKey.LeftArrow:
                    case ConsoleKey.RightArrow:
                        TradeACC.LeftAndRight();
                        break;

                    case ConsoleKey.X:
                        exit = true;
                        break;
                    }
                    Console.CursorVisible = true;
                    if (exit || ((!TradeACC.Vendor.Inventory.Any()) && (!Character.inventory.Any())))
                    {
                        break;
                    }
                    Console.CursorVisible = false;
                }
            }
コード例 #2
0
 internal static void DrawingItems()
 {
     for (int i = 0; i < Vendor.Inventory.Count; i++)
     {
         if (Left)
         {
             if (numOfSelectedItem == i + 1)
             {
                 Console.ForegroundColor = ConsoleColor.Yellow;
             }
             else
             {
                 Console.ResetColor();
             }
         }
         EOA.WriteAt($"{i + 1} {Vendor.Inventory[i].Name}", 0, i + 3);
         EOA.WriteAt($"{Vendor.Inventory[i].Price}", 24, i + 3);
         Console.ResetColor();
         EOA.WriteAt($"│", 28, i + 3);
         EOA.WriteAt($"│", 50, i + 3);
         EOA.WriteAt($"│", 23, i + 3);
     }
     for (int i = 0; i < Character.inventory.Count; i++)
     {
         if (!Left)
         {
             if (numOfSelectedItem == i + 1)
             {
                 Console.ForegroundColor = ConsoleColor.Yellow;
             }
             else
             {
                 Console.ResetColor();
             }
         }
         EOA.WriteAt($"{i + 1} {Character.inventory[i].Name}", 29, i + 3);
         EOA.WriteAt($"{Character.inventory[i].Price}", 51, i + 3);
         Console.ResetColor();
         EOA.WriteAt($"│", 28, i + 3);
         EOA.WriteAt($"│", 50, i + 3);
         EOA.WriteAt($"│", 23, i + 3);
     }
 }
コード例 #3
0
            internal static void Prints()
            {
                Console.ResetColor();
                Console.Clear();

                EOA.WriteAt(Vendor.Name.ToUpper(), 0, 0);
                EOA.WriteAt($"│{Character.name.ToUpper()}", 28, 0);

                for (int i = 0; i < 55; i++)
                {
                    EOA.WriteAt("─", i, 1);
                }

                EOA.WriteAt($"ETHRYL: {Vendor.Ethryl}", 0, 2);
                EOA.WriteAt($"│COST│", 23, 2);
                EOA.WriteAt($"ETHRYL: {Character.ethryl}", 29, 2);
                EOA.WriteAt($"│COST", 50, 2);

                EOA.WriteAt("┬", 23, 1);
                EOA.WriteAt("┬", 50, 1);
                EOA.WriteAt("┼", 28, 1);
            }