Beispiel #1
0
        public bool PridejClenaCommand(string arg = "")
        {
            CrewMember newMember = new CrewMember();

            Console.Write("Zadejte Jméno: ");
            newMember.Name = Console.ReadLine();
            Console.Write("Zadejte Příjmení: ");
            newMember.Surname = Console.ReadLine();
            Console.Write("Zadejte Barvu Týmu: ");
            newMember.Team = Console.ReadLine();

            List <CrewMember> expected = Repository.ExpectedCrewMembers;

            List <CrewMember> matching = expected.Where(e => e.Name == newMember.Name &&
                                                        e.Surname == newMember.Surname &&
                                                        e.Team == newMember.Team).ToList();

            if (matching.Count() == 0)
            {
                Console.WriteLine("Tato osoba se na lodi nenachází! (Zkontrolujte Jméno, Příjmení a Tým");
                return(false);
            }

            List <CrewMember> members = Repository.CrewMembers;

            members.Add(newMember);
            Repository.CrewMembers = members;

            Console.WriteLine("Člen úspěšně přidán");

            return(true);
        }
Beispiel #2
0
        static void ColorfulAnimation()
        {
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 30; j++)
                {
                    Console.Clear();

                    // steam
                    Console.Write("       . . . . o o o o o o", Color.LightGray);
                    for (int s = 0; s < j / 2; s++)
                    {
                        Console.Write(" o", Color.LightGray);
                    }
                    Console.WriteLine();

                    var margin = "".PadLeft(j);
                    Console.WriteLine(margin + "                _____      o", Color.LightGray);
                    Console.WriteLine(margin + "       ____====  ]OO|_n_n__][.", Color.DeepSkyBlue);
                    Console.WriteLine(margin + "      [________]_|__|________)< ", Color.DeepSkyBlue);
                    Console.WriteLine(margin + "       oo    oo  'oo OOOO-| oo\\_", Color.Blue);
                    Console.WriteLine("   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+", Color.Silver);

                    Thread.Sleep(200);
                }
            }
        }
Beispiel #3
0
        Program()
        {
            try
            {
                okservers = File.ReadLines(outputFile).Count();
            }
            catch
            {
                okservers = 0;
            }
            Random r = new Random();

            lines = File.ReadLines(inputFile);
            Console.Out.WriteLine(lines.Count() + " " + lines.ElementAt(lines.Count() - 1));
            for (int i = 1; i < lines.Count(); i++)
            {
                Thread thread1 = new Thread(() => testServer(lines.ElementAt(r.Next(0, lines.Count()))));
                thread1.Start();
                Thread.Sleep(1);
                if (i % THREAD_AMOUNT == 0)
                {
                    Properties.Settings.Default["ServersChecked"] = Convert.ToInt32(Properties.Settings.Default["ServersChecked"].ToString()) + THREAD_AMOUNT;
                    Properties.Settings.Default.Save();
                    Console.Write(Properties.Settings.Default["ServersChecked"].ToString() + " ", Color.Yellow);
                    Console.WriteLine(okservers, Color.Lime);
                    Thread.Sleep(5000);
                }
            }


            Thread.Sleep(10000);
        }
Beispiel #4
0
        private static void WriteLogoForUnix()
        {
            var figlet = GetFont();

            for (var line = 0; line < figlet.ToAscii("Resourceful").CharacterGeometry.GetLength(0); line++)
            {
                var lineChars    = figlet.ToAscii("Resourceful").CharacterGeometry;
                var startColor   = Color.Yellow;
                var endColor     = Color.Fuchsia;
                var currentColor = startColor;
                var rStep        = (startColor.R - endColor.R) / lineChars.GetLength(1);
                var gStep        = (startColor.G - endColor.G) / lineChars.GetLength(1);
                var bStep        = (startColor.B - endColor.B) / lineChars.GetLength(1);

                void PrintWithRgb(char text, byte r, byte g, byte b)
                {
                    Console.Write($"\x1b[38;2;{r};{g};{b}m{text}\x1b[0m");
                }

                PrintWithRgb(lineChars[line, 0], startColor.R, startColor.G, startColor.B);
                for (var col = 1; col < lineChars.GetLength(1); col++)
                {
                    currentColor = Color.FromArgb(
                        red: currentColor.R - rStep,
                        green: currentColor.G - gStep,
                        blue: currentColor.B - bStep);
                    PrintWithRgb(lineChars[line, col], currentColor.R, currentColor.G, currentColor.B);
                }

                Console.Write("\n");
            }
        }
Beispiel #5
0
        public void Start()
        {
            simulation.Prepare();

            Console.WriteLine($"Simulation {simulation.Name} prepared");

            PrintTransactions(simulation.ProcessInstance);

            while (simulation.CanContinue)
            {
                var results = simulation.SimulateNextChunk();

                foreach (var transactionEvent in results)
                {
                    var transaction = simulation.ProcessInstance.GetTransactionById(transactionEvent.TransactionInstanceId);
                    var actor       = simulation.FindActorById(transactionEvent.RaisedByActorId);
                    //    Console.WriteLine($"[{transactionEvent.Created}] Event '{transactionEvent.EventType}' affected transaction '{transaction.Identificator}'. Raised by '{actor.FullName}'");
                    Console.WriteLineFormatted("[{0}] Event affected transaction '{1}'. Raised by '{2}'", Color.Moccasin, Color.WhiteSmoke, new[]
                    {
                        transactionEvent.Created.ToString(),
                        transaction.Identificator,
                        actor.FullName
                    });


                    Console.Write($"\tTransaction's state changed to ");
                    Console.WriteLine(transactionEvent.Completion, Color.Salmon);
                    Console.WriteLine();
                }
                NextCmd(simulation.ProcessInstance);
            }
        }
Beispiel #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="rows"></param>
        public static void writeRowsToExcel(List <Result> results)
        {
            int counter = 3; // counter for rows

            try {
                if (Type.GetTypeFromProgID("Excel.Application") != null)
                {
                    Console.Write("\n\n │ System has excel installed.");
                    Console.Write("\n │\t├─ >> Writing responses to excel ...");
                    using (ExcelPackage excel = new ExcelPackage()) {
                        var headerRow1 = new List <string[]>()
                        {
                            new string[] { DateTime.Now.ToString("dd/MM/yy - HH:mm"), "IBM-XFORCE", " ", " ", "IPAPI", " ", "METADEFENDER", "NEUTRINO" }
                        };
                        var headerRow2 = new List <string[]>()
                        {
                            new string[] { "IP", "IBM-Country", "ASN", "Severity(1-10)", "Organization", "IPapi-Country", "Blacklisted", "Blocklisted" }
                        };
                        // Determine the header range to write over it (e.g. A1:D1)
                        string headerRange1 = "A1:H1";
                        string headerRange2 = "A2:H2";
                        // Target a worksheet
                        excel.Workbook.Worksheets.Add("IP Reputations");
                        var worksheet = excel.Workbook.Worksheets["IP Reputations"];
                        // Populate the cells
                        worksheet.Cells[headerRange1].LoadFromArrays(headerRow1);
                        worksheet.Cells[headerRange1].Style.Font.Size = 12;
                        worksheet.Cells[headerRange1].Style.Font.Color.SetColor(System.Drawing.Color.Blue);

                        worksheet.Cells[headerRange2].LoadFromArrays(headerRow2);
                        worksheet.Cells[headerRange2].Style.Font.Bold = true;
                        worksheet.Cells[headerRange2].Style.Font.Size = 12;
                        worksheet.Cells[headerRange2].Style.Font.Color.SetColor(System.Drawing.Color.Blue);
                        // finally, write rows list to Excel's rows
                        foreach (Result result in results)
                        {
                            worksheet.Cells["A" + counter + ":H" + counter].LoadFromArrays(new List <string[]>()
                            {
                                result.ToArray()
                            });
                            Console.Write("\n │\t\t├─ " + result.ToString());
                            counter++;
                        }
                        File.Delete(outputFileName); // Delete previously created results
                        FileInfo excelFile = new FileInfo(outputFileName);
                        excel.SaveAs(excelFile);
                    }
                    Console.Write("\n │\t├─ >> Writing responses to excel DONE [{0} record written to \\result.xls]", counter - 3);
                }
                else
                {
                    Console.Write("\n │ !System has not excel installed. \n │\t├─ Writing to txt ... ");
                    results.ForEach(rr => File.WriteAllText(@".\result.txt", rr.ToString() + Environment.NewLine));
                    Console.Write("\n │\t├─ Writing to txt DONE [{0} record is written]", results.Count);
                }
            }
            catch (System.Exception e) {
                Console.WriteFormatted("\n │ !!! EXCEPTION while writing to excel: " + e.Message, red);
            }
        }
Beispiel #7
0
        /// <summary>
        /// when writing password to console interface, hides characters
        /// </summary>
        /// <returns></returns>
        static public SecureString darker()
        {
            SecureString   securePwd = new SecureString();
            ConsoleKeyInfo key;

            do
            {
                key = Console.ReadKey(true);
                // Backspace Should Not Work
                if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter)
                {
                    securePwd.AppendChar(key.KeyChar);
                    Console.Write("*");
                }
                else
                {
                    if (key.Key == ConsoleKey.Backspace && securePwd.Length > 0)
                    {
                        securePwd = new NetworkCredential("", securePwd.ToString().Substring(0, (securePwd.Length - 1))).SecurePassword;
                        Console.Write("\b \b");
                    }
                    else if (key.Key == ConsoleKey.Enter)
                    {
                        break;
                    }
                }
            } while (true);
            return(securePwd);
        }
Beispiel #8
0
        } //ErrorMessage
        static void ConsoleDraw(IEnumerable<string> lines, int x, int y) //pulled from https://stackoverflow.com/questions/2725529/how-to-create-ascii-animation-in-windows-console-application-using-c
        {
            if (x > Console.WindowWidth) return;
            if (y > Console.WindowHeight) return;

            var trimLeft = x < 0 ? -x : 0;
            int index = y;

            x = x < 0 ? 0 : x;
            y = y < 0 ? 0 : y;

            var linesToPrint =
                from line in lines
                let currentIndex = index++
                where currentIndex > 0 && currentIndex < Console.WindowHeight
                select new
                {
                    Text = new String(line.Skip(trimLeft).Take(Math.Min(Console.WindowWidth - x, line.Length - trimLeft)).ToArray()),
                    X = x,
                    Y = y++
                };

            Console.Clear();
            foreach (var line in linesToPrint)
            {
                Console.SetCursorPosition(line.X, line.Y);
                Console.Write(line.Text);
            }
        }//ConsoleDraw
Beispiel #9
0
        public void WriteCommandList(CommandLibrary library)
        {
            List <ICommandRoot> commands = library.GetAllCommands().ToList();

            if (!commands.Any())
            {
                Console.WriteLine($"There are 0 available commands!");
                return;
            }

            Console.WriteLine($"{Environment.NewLine}Available Commands:");
            Console.WriteLine($"-------------------");


            int padLen = commands.Max(x => x.Name.Length) + 1;  //add 1 is an arbitrary number.

            //Just gives it some extra padding
            foreach (var command in commands)
            {
                Console.Write(command.Name.PadRight(padLen));
                if (!string.IsNullOrWhiteSpace(command.Description))
                {
                    Console.WriteLine($": {command.Description}", Color.Gray);
                }
                else
                {
                    Console.WriteLine();
                }
            }

            Console.WriteLine();
        }
Beispiel #10
0
        private static async Task Main(string[] args)
        {
            Logger logger = LogManager.GetLogger("Launch");

            var parser = new CommandLineBuilder(LaunchCommand.GetCommand())
                         .UseHost((args) => CreateHostBuilder(args))
                         .UseDefaults()
                         .UseMiddleware(async(context, next) =>
            {
                await next(context);
            })
                         .UseExceptionHandler((ex, context) =>
            {
                var stackTrace = Configuration.GetValue <bool>("ShowStackTraceOnError")
                        ? ex.StackTrace
                        : "Error details hidden. Enable 'ShowStackTraceOnError' to see more...";

                logger.Error(ex, $"The global exception handler caught an exception: {ex.Message}{Environment.NewLine}{stackTrace}");
                logger.Info($"Press any key to close...");
                Console.ReadKey();
            })
                         .Build();

            // display some startup info

            Console.WriteAscii("Launch", Color.FromArgb(204, 102, 0));
            Console.Write($"Version: ");
            parser.Parse("--version").Invoke();

            // parse the arguments
            await parser.InvokeAsync(args);
        }
 private static void InitializePlayfield()
 {
     for (int i = 0; i < PField.GetLength(0); i++)
     {
         for (int j = 0; j < PField.GetLength(1); j++)
         {
             PField[i, j] = new Block(false, Color.Black);
         }
     }
     Console.ForegroundColor  = BorderColor;
     PField[0, 0]             = new Block(true, BorderColor);
     PField[PFP.Width + 1, 0] = new Block(true, BorderColor);
     for (int i = 0; i < PFP.Height; i++)
     {
         Console.SetCursorPosition(PFP.X, PFP.Y + i);
         Console.Write(new string(BorderChar, 2) + new string(SpaceChar, PFP.Width * 2) + new string(BorderChar, 2));
         PField[0, i + 1]             = new Block(true, BorderColor);
         PField[PFP.Width + 1, i + 1] = new Block(true, BorderColor);
     }
     Console.SetCursorPosition(PFP.X, PFP.Y + PFP.Height);
     Console.Write(new string(BorderChar, 4 + PFP.Width * 2));
     for (int i = 0; i < PField.GetLength(0); i++)
     {
         PField[i, PFP.Height + 1] = new Block(true, BorderColor);
     }
 }
Beispiel #12
0
        public static void DrawField()
        {
            Console.SetCursorPosition(Field[0].X, Field[0].Y);
            Console.Write("+" + new string('-', Field[1].X) + "+");
            Console.SetCursorPosition(Field[0].X, Field[0].Y + Field[1].Y + 1);
            Console.Write("+" + new string('-', Field[1].X) + "+");
            Console.SetCursorPosition(0, Field[0].Y + 1);
            for (int line = 0; line < Field[1].Y; ++line)
            {
                Console.WriteLine(new string(' ', Field[0].X) + "|".PadRight(Field[1].X + 1) + "|");
            }
            var fore = Console.ForegroundColor;

            foreach (var apple in Apples)
            {
                Console.SetCursorPosition(apple.X, apple.Y);
                Console.ForegroundColor = Color.Red;
                Console.Write(((apple.X ^ apple.Y) & 0x01) == 1 ? '9' : '6');
            }
            foreach (var cure in Cures)
            {
                Console.SetCursorPosition(cure.X, cure.Y);
                Console.ForegroundColor = Color.Yellow;
                Console.Write("C");
            }
            foreach (var poison in Poisons)
            {
                Console.SetCursorPosition(poison.X, poison.Y);
                Console.ForegroundColor = Color.Magenta;
                Console.Write("P");
            }
            Console.ForegroundColor = fore;
        }
Beispiel #13
0
 public static void Print(string msg)
 {
     if (!Silent)
     {
         Console.Write(msg);
     }
 }
Beispiel #14
0
        public static void DrawSnake()
        {
            var head  = Snake[Snake.Count - 1];
            var newXY = Move(head);

            if (Snake.IndexOf(newXY) >= 0)
            {
                if (Snake.IndexOf(newXY) == Snake.Count - 2)
                {
                    Reverse();
                    newXY = Move(head);
                }
                else
                {
                    SubstractLife();
                    return;
                }
            }
            if (newXY.X == Field[0].X || newXY.X == Field[0].X + Field[1].X + 1 ||
                newXY.Y == Field[0].Y || newXY.Y == Field[0].Y + Field[1].Y + 1)
            {
                SubstractLife();
                return;
            }
            if (Cures.Remove(newXY))
            {
                ++Lifes;
                ++RecordInfo.TotalCures;
                ++RecordInfo.TotalLifes;
            }
            if (Poisons.Remove(newXY))
            {
                Console.SetCursorPosition(newXY.X, newXY.Y);
                Console.Write(' ');
                ++RecordInfo.TotalPoisons;
                SubstractLife();
                return;
            }
            var fore = Console.ForegroundColor;

            Console.ForegroundColor = Color.LimeGreen;
            if (!Apples.Remove(newXY))
            {
                Snake.RemoveAt(0);
            }
            else
            {
                ++Score;
                ++RecordInfo.TotalScore;
            }
            foreach (var coord in Snake)
            {
                Console.SetCursorPosition(coord.X, coord.Y);
                Console.Write('#');
            }
            Snake.Add(newXY);
            Console.SetCursorPosition(newXY.X, newXY.Y);
            Console.Write('O');
            Console.ForegroundColor = fore;
        }
Beispiel #15
0
        /// <summary> Checks given IP for error/fouls in syntax </summary>
        static bool checkIP(string IP)
        {
            // check whether given url is valid or not
            IPAddress address;

            if (IPAddress.TryParse(IP, out address))
            {
                switch (address.AddressFamily)
                {
                case System.Net.Sockets.AddressFamily.InterNetwork:
                    Console.Write("\n │ " + IP + " is IPv4");
                    return(true);

                case System.Net.Sockets.AddressFamily.InterNetworkV6:
                    Console.Write("\n │ " + IP + " is IPv6");
                    return(true);

                default:
                    Console.WriteFormatted("\n ! " + IP + " is NOT valid", red);
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Beispiel #16
0
        private Item DropItems(Item item, List <string> inputs)
        {
            if (inputs.Count > 1)
            {
                inputs.RemoveAt(0);
                string wholeItemName = string.Join(" ", inputs);

                if (player.GetItems() != null)
                {
                    item = player.Drop(wholeItemName);
                    if (item != null)
                    {
                        player.RemoveItem(item);
                        currentRoom.AddItem(item);
                        Console.Write("You dropped a ");
                        PrintItem(item);
                        Console.WriteLine(". ");
                    }
                }
            }
            else
            {
                Console.WriteLine("Drop what?");
            }
            return(item);
        }
Beispiel #17
0
        /// <summary> Searches(contains) given URL in txt </summary>
        static bool searchUrl(string URL)
        {
            bool found = false;

            string[] dots = { ".", "..", "..." };
            try {
                using (StreamReader file = new StreamReader(urlblissFileName)) {
                    if (file.ReadLine() == null)
                    {
                        Console.WriteLineFormatted("\n │ ! Failure when reading file.", red);
                    }
                    else
                    {
                        short  counterLines = 0;
                        string currLine;
                        while ((currLine = file.ReadLine()) != null)
                        {
                            Helpers.NOP(200); // waits a little bit, the greater the longer
                            Console.Write("\r\t│ [{0}] Looking {1}   ", counterLines, dots[(counterLines / 600) % 3]);
                            counterLines++;
                            if (currLine.Contains(URL))
                            {
                                Console.Write("\n\t│ Found at line [{0}] > {1}\n", counterLines, currLine);
                                found = true;
                            }
                        } // loop
                    }     // if-else
                }         // file read
            }             // try
            catch (Exception e) {
                Console.WriteLineFormatted("\n!│ Reading exception: " + e.Message, red);
                new SoundPlayer(URLbliss.Properties.Resources.gurg).Play();
            }
            return(found);
        }
Beispiel #18
0
        public static int PrintMainMenu(string strLogInOut, Client myActiveClient)
        {
            ColorAlternatorFactory alternatorFactory = new ColorAlternatorFactory();
            ColorAlternator        alternator        = alternatorFactory.GetAlternator(1, Color.Aqua, Color.Aquamarine);
            string strOp;

            Console.Clear();
            Console.ResetColor();
            HpVarious.WriteArt(APP_NAME);
            if (myActiveClient.Name != null)
            {
                Console.WriteLine($"{myActiveClient.Name} {myActiveClient.LastName} ({(DateTime.Today.Year - myActiveClient.Birthdate.Year).ToString()} años), Bienvenido...\n", Color.AliceBlue);
            }
            Console.WriteLineAlternating("\t(1) MOSTRAR CATALOGO", alternator);
            Console.WriteLineAlternating("\t(2) ALQUILAR/DEVOLVER PELICULA", alternator);
            Console.WriteLineAlternating("\t(3) MIS ALQUILERES", alternator);
            Console.WriteLineAlternating($"\t(4) {strLogInOut}", alternator);
            Console.WriteLineAlternating("\t(5) SALIR", alternator);
            do
            {
                Console.Write("\nOpcion: ", Color.CadetBlue);
                Console.ResetColor();
                strOp = HpVarious.ReadNumber("12345", 1);
            } while (strOp == "");

            Console.ResetColor();
            return(Convert.ToInt32(strOp));//return Convert.ToInt32(Console.ReadLine());
        }
Beispiel #19
0
        private void Execute(LogSeverity s, LogSource src, string message, Exception e)
        {
            var content = new StringBuilder();

            var(color, value) = VerifySeverity(s);
            Append($"{value}:".PadRight(10), color);
            var dto = DateTimeOffset.UtcNow;

            content.Append($"[{dto.FormatDate()} | {dto.FormatFullTime()}] {value} -> ");

            (color, value) = VerifySource(src);
            Append($"[{value}]".PadRight(10), color);
            content.Append($"{value} -> ");

            if (!message.IsNullOrWhitespace())
            {
                Append(message, Color.White);
                content.Append(message);
            }

            if (e != null)
            {
                var toWrite = $"{Environment.NewLine}{e.Message}{Environment.NewLine}{e.StackTrace}";
                Append(toWrite, Color.IndianRed);
                content.Append(toWrite);
                LogExceptionInDiscord(e);
            }

            Console.Write(Environment.NewLine);
            content.AppendLine();
            if (Config.EnabledFeatures.LogToFile)
            {
                File.AppendAllText(LogFile, content.ToString());
            }
        }
Beispiel #20
0
 public static void printLogo()
 {
     Console.Clear();
     Console.WriteLine(Program.logo);
     Console.WriteLine("");
     Console.Write("[OUTLAWZ] ", Color.LightGoldenrodYellow);
 }
Beispiel #21
0
        public void Start()
        {
            Console.Clear();

            while (!ALineWon())
            {
                for (int i = 0; i < RacingLines.Count; ++i)
                {
                    RacingLines[i].TryToRun();
                }

                Thread.Sleep(20);
            }

            Line winner = GetWinningLine();

            Console.Clear();

            int    consoleHalfWidth = Console.WindowWidth / 2;
            string winningLineMsg   = "The Winning Line is: ";

            Console.SetCursorPosition(consoleHalfWidth - (winningLineMsg.Length / 2), (Console.WindowHeight / 2) - 5);
            Console.WriteLine(winningLineMsg, Color.White);
            Console.SetCursorPosition((Console.WindowWidth / 2) - 4, (Console.WindowHeight / 2) - 3);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[0]);
            Console.Write(winner.Symbol, winner.LineColors.Colors[1]);

            Console.ForegroundColor = Color.White;
            Console.ReadKey();
        }
Beispiel #22
0
        private void MoveTo(string direction)
        {
            Room peekRoom = currentRoom.Look(direction);   //Change room to the looking direction

            if (peekRoom == null)
            {
                Console.WriteLine("You can't go there dummy! ");
            }
            else
            {
                //TODO: GET DOOR and see if it's open
                Door door = currentRoom.GetDoor(direction);
                if (door != null)
                {
                    Console.Write("There is a ");
                    PrintItem(door);
                    if (door.Locked == true)
                    {
                        Console.WriteLine(". It seems to be locked. ");
                    }
                    else
                    {
                        Console.WriteLine(" You open it and enter. ");
                        currentRoom = peekRoom;
                    }
                    Console.WriteLine();
                }
                else
                {
                    currentRoom = peekRoom;
                }
            }
        }
Beispiel #23
0
        public static void WriteSermonWord()
        {
            Console.Write("      ___           ___           ___	  ", Color.Yellow);
            Console.WriteLine("     ___           ___           ___", Color.White);

            Console.Write(@"     /  /\         /  /\         /  /\	  ", Color.Yellow);
            Console.WriteLine(@"    /  /\         /  /\         /  /\", Color.White);

            Console.Write(@"    /  /::\       /  /::\       /  /::\   ", Color.Yellow);
            Console.WriteLine(@"   /  /::|       /  /::\       /  /::|", Color.White);

            Console.Write(@"   /__/:/\:\     /  /:/\:\     /  /:/\:\  ", Color.Yellow);
            Console.WriteLine(@"  /  /:|:|      /  /:/\:\     /  /:|:|", Color.White);

            Console.Write(@"  _\_ \:\ \:\   /  /::\ \:\   /  /::\ \:\ ", Color.Yellow);
            Console.WriteLine(@" /  /:/|:|__   /  /:/  \:\   /  /:/|:|__", Color.White);

            Console.Write(@" /__/\ \:\ \:\ /__/:/\:\ \:\ /__/:/\:\_\:\", Color.Yellow);
            Console.WriteLine(@"/__/:/_|::::\ /__/:/ \__\:\ /__/:/ |:| /\", Color.White);

            Console.Write(@" \  \:\ \:\_\/ \  \:\ \:\_\/ \__\/~|::\/:/", Color.Yellow);
            Console.WriteLine(@"\__\/  /~~/:/ \  \:\ /  /:/ \__\/  |:|/:/", Color.White);

            Console.Write(@"  \  \:\_\:\    \  \:\ \:\      |  |:|::/ ", Color.Yellow);
            Console.WriteLine(@"      /  /:/   \  \:\  /:/      |  |:/:/", Color.White);

            Console.Write(@"   \  \:\/:/     \  \:\_\/      |  |:|\/  ", Color.Yellow);
            Console.WriteLine(@"     /  /:/     \  \:\/:/       |__|::/", Color.White);

            Console.Write(@"    \  \::/       \  \:\        |__|:|~   ", Color.Yellow);
            Console.WriteLine(@"    /__/:/       \  \::/        /__/:/", Color.White);

            Console.Write(@"     \__\/         \__\/         \__\|    ", Color.Yellow);
            Console.WriteLine(@"    \__\/         \__\/         \__\/", Color.White);
        }
Beispiel #24
0
        public bool ActivateCommand(string arg = "")
        {
            //show loading
            var    percent  = 0;
            Random random   = new Random();
            int    loadRate = random.Next(1, 50);

            while (percent < 100)
            {
                percent += random.Next(1, loadRate);
                percent  = Math.Min(percent, 100);
                Console.Write("\rZkouším aktivovat klíčem ... " + percent + " %");
                System.Threading.Thread.Sleep(200);
            }
            Console.WriteLine();

            List <Experience> exps = Repository.Experiences;
            Experience        exp  = exps.Where(e => e.KeyToUnlock == arg).FirstOrDefault();

            if (String.IsNullOrEmpty(arg) || exp == null)
            {
                Console.WriteLine("Klíč " + arg + " nic neodemkl :(", Color.Red);
                return(false);
            }

            exp.KeyToUnlock        = null; //this makes it activated
            Repository.Experiences = exps;

            Console.WriteLine("Klíč aktivoval novou aplikaci '" + exp.Name + "'");


            return(true);
        }
Beispiel #25
0
        public bool RunExperienceCommand(string arg = "")
        {
            Experience exp = Repository.Experiences.Where(e => String.IsNullOrEmpty(e.KeyToUnlock) &&
                                                          e.Name == arg)
                             .FirstOrDefault();

            if (String.IsNullOrEmpty(arg) || exp == null)
            {
                Console.WriteLine("Zážitek " + arg + " jsme tu bohužel nenašli :(", Color.Red);
                Console.WriteLine("(Pokud od něj máš aktivační klíč, můžeš si ho odemknout)");
                return(false);
            }
            //show loading
            var    percent  = 0;
            Random random   = new Random();
            int    loadRate = random.Next(1, 50);

            while (percent < 100)
            {
                percent += random.Next(1, loadRate);
                percent  = Math.Min(percent, 100);
                Console.Write("\rSpouštíme zážitek ... " + percent + " %");
                System.Threading.Thread.Sleep(200);
            }
            Console.WriteLine();

            Console.WriteLine(exp.Name + " běží. Nasaďte si své prasečí příslušenství ;)", Color.DarkMagenta);

            return(true);
        }
Beispiel #26
0
 public static void FatalError(string message = "")
 {
     Log(message, Level.Fatal, LogTarget.Console, LogTarget.File);
     Console.Write("Press Enter to Quit...", Color.Red);
     Console.ReadLine();
     Environment.Exit(1);
 }
Beispiel #27
0
 public static void Typewrite(string message, System.Drawing.Color color)
 {
     for (int i = 0; i < message.Length; i++)
     {
         Console.Write(message[i].ToString(), color);
         System.Threading.Thread.Sleep(60);
     }
 }
Beispiel #28
0
        static void exit(int ecode = 0)
        {
            Console.WriteLine(" ");
            Console.Write("press any key to continue...");
            Console.ReadKey(true);

            Environment.Exit(ecode);
        }
Beispiel #29
0
 static void RainbowText(string inp)
 {
     foreach (char c in inp)
     {
         Console.Write(c, colors[rng.Next(0, colors.Length - 1)]);
     }
     Console.Write("\n");
 }
Beispiel #30
0
 public static void DrawWelcome()
 {
     Console.BackgroundColor = Color.DarkSlateBlue;
     Console.Clear();
     Console.ForegroundColor = Color.LightYellow;
     Console.SetCursorPosition(0, Console.WindowHeight / 2 - 1);
     Console.Write(Center(StringWelcome, Console.WindowWidth));
 }