コード例 #1
0
        public static void CalcNotepadPlayer(object obj)
        {
            Random        ran = new Random();
            int           NotepadBehavior;
            NotepadPlayer user = (NotepadPlayer)obj;

            List <int> SaveIntList = new List <int>();

            for (int i = 0; i < 100; i++)
            {
                if (MainList.ReturnMainCount(user.Name) <= 0)
                {
                    //Console.WriteLine($"NotepadPlayer:{MainList.ReturnMainCount(user.Name)}");
                    break;
                }
                else
                {
                    NotepadBehavior = ran.Next(40, 140);

                    foreach (var item in SaveIntList)
                    {
                        if (item == NotepadBehavior)
                        {
                            while (item == NotepadBehavior)
                            {
                                NotepadBehavior = ran.Next(40, 140);
                            }
                        }
                    }
                    if (user.StepFinish == NotepadBehavior)
                    {
                        //Console.BackgroundColor = ConsoleColor.Red;
                        //Console.ForegroundColor = ConsoleColor.White;
                        //Console.WriteLine($"Lucky{user.Name}[Step:{i}] {NotepadBehavior} = {Convert.ToInt32(user.StepFinish)}");
                        //Console.ResetColor();
                        MainList.ChangeStepFinishPlayer(user.Name, i);
                        MainList.SetMainCount(); //set MainCount = 0 if somebody win
                        break;
                    }
                    else
                    {
                        HistoryListLogic.AddHistory(new HistoryList(_historyRow: NotepadBehavior, _namePlayer: user.Name));
                    }
                    // else Console.WriteLine($"({user.Name}[Step:{i}] {NotepadBehavior} != {Convert.ToInt32(user.StepFinish)}");

                    MainList.ChangeMainCount();
                    SaveIntList.Add(NotepadBehavior);
                }
            }
        }
コード例 #2
0
        public static void CalcUberChiterPlayer(object obj)
        {
            int UberChiterBehavior, step = 0;
            UberChiterPlayer user = (UberChiterPlayer)obj;

            for (int i = 40; i < 141; i++)
            {
                if (MainList.ReturnMainCount(user.Name) <= 0)
                {
                    //Console.WriteLine($"UberChiterPlayer:{MainList.ReturnMainCount(user.Name)}");
                    break;
                }
                else
                {
                    UberChiterBehavior = i;
                    foreach (HistoryList item in HistoryListLogic.GetHistoryList)
                    {
                        if (item.HistoryRow == UberChiterBehavior)
                        {
                            UberChiterBehavior = i++;
                        }
                    }
                    if (user.StepFinish == UberChiterBehavior)
                    {
                        //Console.BackgroundColor = ConsoleColor.Red;
                        //Console.ForegroundColor = ConsoleColor.White;
                        //Console.WriteLine($"Lucky{user.Name}[Step:{step}] {UberChiterBehavior} = {Convert.ToInt32(user.StepFinish)}");
                        //Console.ResetColor();
                        MainList.ChangeStepFinishPlayer(user.Name, step);
                        MainList.SetMainCount(); //set MainCount = 0 if somebody win
                        break;
                    }
                    //else Console.WriteLine($"({user.Name}[Step:{step}] {ChiterBehavior} != {Convert.ToInt32(user.StepFinish)}");
                    step++;
                    MainList.ChangeMainCount();
                }
            }
        }
コード例 #3
0
        public static void CalcSimplePlayer(object obj)
        {
            Random       ran = new Random();
            int          SimbleBehavior;
            SimplePlayer user = (SimplePlayer)obj;

            for (int i = 0; i < 100; i++)
            {
                if (MainList.ReturnMainCount(user.Name) <= 0)
                {
                    //Console.WriteLine($"SimplePlayer:{MainList.ReturnMainCount(user.Name)}");
                    break;
                }
                else
                {
                    SimbleBehavior = ran.Next(40, 140);
                    if (user.StepFinish == SimbleBehavior)
                    {
                        //Console.BackgroundColor = ConsoleColor.Red;
                        //Console.ForegroundColor = ConsoleColor.White;
                        //Console.WriteLine($"Lucky{user.Name}[Step:{i}] {SimbleBehavior} = {Convert.ToInt32(user.StepFinish)}");
                        //Console.ResetColor();
                        MainList.ChangeStepFinishPlayer(user.Name, i);
                        MainList.SetMainCount(); //set MainCount = 0 if somebody win
                        break;
                    }
                    else
                    {
                        HistoryListLogic.AddHistory(new HistoryList(_historyRow: SimbleBehavior, _namePlayer: user.Name));
                    }


                    MainList.ChangeMainCount();
                    // else Console.WriteLine($"({user.Name}[Step:{i}] {SimbleBehavior} != {Convert.ToInt32(user.StepFinish)}");
                }
            }
        }