public void GenerateTestusingDefaults()
        {
            SpecialList list = new SpecialList();
            Dictionary <int, string> newlist = list.Generate();

            Assert.IsTrue(newlist.Count == 100);
        }
Beispiel #2
0
 public override void Bind(Entity entity)
 {
     base.Bind(entity);
     if (entity is Building)
     {
         Building t = entity as Building;
         InsiderList.Bind(t, t.Insider);
         WorkerList.Bind(t, t.Workers);
         if (t is Inn)
         {
             SpecialList.Bind(t, (t as Inn).Livers);
             SpecialText.text = "Livers";
         }
         else if (t is Company)
         {
             SpecialList.Bind(t, (t as Company).Officers);
             SpecialText.text = "Officers";
         }
         else if (t is Hall)
         {
             SpecialList.Bind(t, (t as Hall).Homeless);
             SpecialText.text = "Homeless";
         }
         else
         {
             SpecialList.Clear();
         }
     }
     GenerationPanel.SetActive(entity is Inn);
 }
 public override void Clear()
 {
     base.Clear();
     InsiderList.Clear();
     SpecialList.Clear();
     WorkerList.Clear();
 }
 public void LateUpdate()
 {
     if (target && target is Inn)
     {
         GenerateButton.interactable = (target as Inn).CheckNewPerson();
         GenProgress.Value           = (target as Inn).BirthStatus;
         InsiderList.Refresh();
         WorkerList.Refresh();
         SpecialList.Refresh();
     }
 }
Beispiel #5
0
        public override void MatchCards(List <UserMatchInfo> matchInfoList)
        {
            foreach (UserMatchInfo matchInfo in matchInfoList)
            {
                if (matchInfo.Special > (int)CardType.none)
                {
                    SpecialList.Add(matchInfo);


                    DunScore dunScore = new DunScore
                    {
                        Seat        = matchInfo.Seat,
                        NormalScore = new List <int>(),
                        AddScore    = new List <int>()
                    };
                    ShootScoreArray = matchInfo.ShootScore;
                    for (int i = 0; i < matchInfo.AddScore.Count; i++)
                    {
                        dunScore.NormalScore.Add(matchInfo.NormalScores[i]);
                        dunScore.AddScore.Add(matchInfo.AddScore[i]);
                    }
                    continue;
                }

                MatchInfoList.Add(matchInfo);

                if (matchInfo.Shoot != null && matchInfo.Shoot.ShootCount > 0)
                {
                    ShootList.Add(matchInfo.Shoot);
                }


                ShootScoreArray = matchInfo.ShootScore;
                for (int i = 0; i < matchInfo.AddScore.Count; i++)
                {
                    DunScoreList.Add(new DunScore()
                    {
                        Seat        = matchInfo.Seat,
                        NormalScore = matchInfo.NormalScores,
                        AddScore    = matchInfo.AddScore
                    });
                }

                if (matchInfo.Swat)
                {
                    _hasSwat = true;
                }
            }

            MatchBegin(); //开始比牌
        }
        public void GenerateTestusing5andFunwithMaxof50()
        {
            SpecialList list = new SpecialList();

            list.CounterHighlights = new Dictionary <int, string>()
            {
                { 5, "Fun" }
            };
            list.Max = 50;
            Dictionary <int, string> newlist = list.Generate();

            Assert.IsTrue(newlist.Count == 50);
            string outstring = string.Empty;

            newlist.TryGetValue(5, out outstring);
            Assert.IsTrue(outstring == "Fun");
        }
Beispiel #7
0
        private static void Main(string[] args)
        {
            SpecialList specialList = new SpecialList
            {
                Max = 1000,
                CounterHighlights = new Dictionary <int, string>()
                {
                    { 5, "Fun" }, { 6, "More Fun" }
                }
            };
            Dictionary <int, string> list = specialList.Generate();

            foreach (var item in list)
            {
                Console.WriteLine(item.Value);
            }
            Console.ReadLine();
        }
Beispiel #8
0
    static int Main()
    {
        IList <int> list   = new List <int> ();
        int         result = list.Map("Hello");

        if (result != 1)
        {
            return(1);
        }

        IList <int> list2   = new SpecialList <int> ();
        int         result2 = list2.Map("World");

        if (result2 != 2)
        {
            return(2);
        }

        return(0);
    }
Beispiel #9
0
    static int Test1()
    {
        Console.WriteLine("----Test1");
        IList <int> list   = new List <int>();
        int         result = list.Map("Hello");

        if (result != 1)
        {
            return(1);
        }

        IList <int> list2   = new SpecialList <int>();
        int         result2 = list2.Map("World");

        if (result2 != 2)
        {
            return(2);
        }

        return(0);
    }
        private async Task FilterPageAppears()
        {
            var Mainapp = Application.Current as App;

            if (CName.Equals("Movies"))
            {
                if (LType.Equals("Highest"))
                {
                    topLabel.Text = "High to Low Rate";
                    var List = await itemViewModel.GetMoviesHighRateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //High Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Lowest"))
                {
                    topLabel.Text = "Low to High Rate";
                    var List = await itemViewModel.GetMoviesHighRateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Newest"))
                {
                    topLabel.Text = "Newest to Oldest";
                    var List = await itemViewModel.GetMoviesDateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Oldest"))
                {
                    topLabel.Text = "Oldest to Newest";
                    var List = await itemViewModel.GetMoviesDateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
            }
            else if (CName.Equals("Series"))
            {
                if (LType.Equals("Highest"))
                {
                    topLabel.Text = "High to Low Rate";
                    var List = await itemViewModel.GetSeriesHighRateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //High Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Lowest"))
                {
                    topLabel.Text = "Low to High Rate";
                    var List = await itemViewModel.GetSeriesHighRateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Newest"))
                {
                    topLabel.Text = "Newest to Oldest";
                    var List = await itemViewModel.GetSeriesDateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Oldest"))
                {
                    topLabel.Text = "Oldest to Newest";
                    var List = await itemViewModel.GetSeriesDateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
            }

            else if (CName.Equals("Games"))
            {
                if (LType.Equals("Highest"))
                {
                    topLabel.Text = "High to Low Rate";
                    var List = await itemViewModel.GetGamesHighRateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //High Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Lowest"))
                {
                    topLabel.Text = "Low to High Rate";
                    var List = await itemViewModel.GetGamesHighRateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Newest"))
                {
                    topLabel.Text = "Newest to Oldest";
                    var List = await itemViewModel.GetGamesDateFirst(Mainapp.Email);

                    List.Reverse();
                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
                else if (LType.Equals("Oldest"))
                {
                    topLabel.Text = "Oldest to Newest";
                    var List = await itemViewModel.GetGamesDateFirst(Mainapp.Email);

                    foreach (var item in List)
                    {
                        //Low Rate First
                        if (!SpecialList.Any((arg) => arg.ItemID == item.ItemID && arg.PublisherEmail == Mainapp.Email))
                        {
                            SpecialList.Add(item);
                        }
                    }
                }
            }
            else
            {
            }
        }