Пример #1
0
        internal static void ParseCommand(this string self)
        {
            string[] vars = self.Split();

            if (vars[0] == "/system")
            {
                if (vars[1] == "find")
                {
                    Logging.Print("\nPlaceholder\n");
                }
                else if (vars[1] == "coords")
                {
                    Console.WriteLine();
                    byte[] seed = vars[2].SystemCoordsToByteArray();
                    if (seed != null)
                    {
                        SystemName.FormatName(seed);
                    }
                }
                else if (vars[1] == "xcoords")
                {
                    Console.WriteLine();
                    byte[] seed = vars.SystemXCoordsToByteArray();
                    if (seed != null)
                    {
                        SystemName.FormatName(seed);
                    }
                }
                else if (vars[1] == "grfcoords")
                {
                    Console.WriteLine();
                    SystemName.FormatName(vars[2].Parse());
                }
                else
                {
                    Logging.PrintError("\nCould not parse input! Are you sure you typed the command correctly?\n");
                }
            }
            else if (vars[0] == "/region")
            {
                if (vars[1] == "find")
                {
                    Logging.Print("\nPlaceholder\n");
                }
                else if (vars[1] == "coords")
                {
                    Console.WriteLine();
                    byte[] seed = vars[2].RegionCoordsToByteArray();
                    if (seed != null)
                    {
                        RegionName.FormatName(seed);
                    }
                }
                else if (vars[1] == "xcoords")
                {
                    Console.WriteLine();
                    byte[] seed = vars.RegionXCoordsToByteArray();
                    if (seed != null)
                    {
                        RegionName.FormatName(seed);
                    }
                }
                else if (vars[1] == "grfcoords")
                {
                    Console.WriteLine();
                    RegionName.FormatName(vars[2].Parse());
                }
                else
                {
                    Logging.PrintError("\nCould not parse input! Are you sure you typed the command correctly?\n");
                }
            }
            else if (vars[0] == "debug")
            {
                Debug = !Debug;
                Logging.Print("Toggled debug mode!");
            }
            else
            {
                Logging.PrintError("\nCould not parse input! Are you sure you typed the command correctly?\n");
            }
        }