Пример #1
0
 private void Update()
 {
     // if mouse press -> send co-ordinates to A-star pathfinding agent
     if (Input.GetMouseButtonDown(0))
     {
         world.Tile target = MouseRead.MouseRaycast();
         if (target != null)
         {
             if (!target.isWall)
             {
                 Vector2Int        destination = target.index;
                 List <Vector2Int> path        = astar.FindPath(destination, new Vector2Int((int)character.itemRep.transform.position.x, (int)character.itemRep.transform.position.y), map, 0.2f);
                 collorPath(path);
                 character.traversePath(path, map);
             }
         }
     }
 }
Пример #2
0
        public void clientLogin()
        {
            ConsoleApp1.localhost.WebService1 obj = new ConsoleApp1.localhost.WebService1();
            LaptopRead   lap      = new LaptopRead();
            MouseRead    mouse    = new MouseRead();
            PendriveRead pendrive = new PendriveRead();
            var          table    = new ConsoleTable("Shop Name", "Shop Type", "Shop Id");

            table.AddRow("CRAZY MACHINES", "Laptop Shop", "Laptop/laptop")
            .AddRow("Tech Froggy Systems", "Mouse Shop", "Mouse/mouse")
            .AddRow("Byte Smith Systems", "Pendrive Shop", "Pendrive/pendrive");
            Console.WriteLine(table);
            Console.WriteLine();
            Console.Write("Enter the shop Id you wish to Login - ");
            string id = Console.ReadLine();

            if (id == "Laptop" || id == "laptop")
            {
                connectToServer(id);
                Console.Title = "CRAZY MACHINES";
                string select;
                Console.WriteLine("Shop:1 - CRAZY MACHINES");
                Console.WriteLine();
                Console.Write("Press 1 to view operations - ");
                select = Console.ReadLine();
                Console.Clear();
                if (select == "1")
                {
                    string choice;
                    do
                    {
                        dynamic x = obj.Getlaptop();
                        Console.WriteLine(" * Press 1 to Billing   - Purchasing of Items");
                        Console.WriteLine(" * Press 2 for updation - Updating the Items price and Stock level of the items in current Inventory");
                        Console.WriteLine(" * Press 3 for Addition - Addition of new Items to the existing Catalogue");
                        Console.WriteLine(" * Press 4 for Deletion - Deleting the Existing Items from the Catalogue");
                        Console.WriteLine(" * Press 5 for Exit     - Got Exhausted of purchasing! Bye");
                        Console.WriteLine();
                        Console.Write("Enter the Choice - ");
                        choice = Console.ReadLine();
                        Console.Clear();
                        if (choice == "1")
                        {
                            lap.lapDisplay(x);
                        }
                        else if (choice == "2")
                        {
                            lap.updateDetail();
                        }
                        else if (choice == "3")
                        {
                            lap.addDetail();
                        }
                        else if (choice == "4")
                        {
                            lap.deleteDetail();
                        }
                        else if (choice == "5")
                        {
                            requestLoop();
                        }
                    } while (choice != "5");
                }
            }
            else if (id == "Mouse" || id == "mouse")
            {
                connectToServer(id);
                Console.Title = "Tech Froggy Systems";
                Console.WriteLine("Shop:2 - Tech Froggy Systems");
                Console.WriteLine();
                Console.Write("1.Press 1 to view options - ");
                string select = Console.ReadLine();
                Console.Clear();
                if (select == "1")
                {
                    string choice;
                    do
                    {
                        dynamic y = obj.Getmouse();
                        Console.WriteLine(" * Press 1 to Billing   - Purchasing of Items");
                        Console.WriteLine(" * Press 2 for updation - Updating the Items price and Stock level of the items in current Inventory");
                        Console.WriteLine(" * Press 3 for Addition - Addition of new Items to the existing Catalogue");
                        Console.WriteLine(" * Press 4 for Deletion - Deleting the Existing Items from the Catalogue");
                        Console.WriteLine(" * Press 5 for Exit     - Got Exhausted of purchasing! Bye");
                        Console.WriteLine();
                        Console.Write("Enter the Choice - ");
                        choice = Console.ReadLine();
                        Console.Clear();

                        if (choice == "1")
                        {
                            mouse.mouseDisplay(y);
                        }
                        else if (choice == "2")
                        {
                            mouse.updateDetail();
                        }
                        else if (choice == "3")
                        {
                            mouse.addDetail();
                        }
                        else if (choice == "4")
                        {
                            mouse.deleteDetail();
                        }
                        else if (choice == "5")
                        {
                            requestLoop();
                        }
                    } while (choice != "5");
                }
            }
            else if (id == "Pendrive" || id == "pendrive")
            {
                connectToServer(id);
                Console.Title = "Byte Smith Systems";
                Console.WriteLine("Shop:3 - Byte Smith Systems");
                Console.ReadLine();
                Console.Write("1.Press 1 to view options - ");
                string select = Console.ReadLine();
                Console.Clear();
                if (select == "1")
                {
                    string choice;
                    do
                    {
                        dynamic z = obj.Getpendrive();
                        Console.WriteLine(" * Press 1 to Billing   - Purchasing of Items");
                        Console.WriteLine(" * Press 2 for updation - Updating the Items price and Stock level of the items in current Inventory");
                        Console.WriteLine(" * Press 3 for Addition - Addition of new Items to the existing Catalogue");
                        Console.WriteLine(" * Press 4 for Deletion - Deleting the Existing Items from the Catalogue");
                        Console.WriteLine(" * Press 5 for Exit     - Got Exhausted of purchasing! Bye");
                        Console.WriteLine();
                        Console.Write("Enter the Choice - ");
                        choice = Console.ReadLine();
                        Console.Clear();
                        if (choice == "1")
                        {
                            pendrive.pendriveDisplay(z);
                            requestLoop();
                            exit();
                        }
                        else if (choice == "2")
                        {
                            pendrive.updateDetail();
                        }
                        else if (choice == "3")
                        {
                            pendrive.addDetail();
                        }
                        else if (choice == "4")
                        {
                            pendrive.deleteDetail();
                        }
                        else if (choice == "5")
                        {
                            requestLoop();
                        }
                    } while (choice != "5");
                }
            }
            else
            {
                Console.WriteLine("Please enter the correct ID");
                clientLogin();
                Console.ReadLine();
            }
        }