Ejemplo n.º 1
0
        public override void SetParaMeters(params string[] args)
        {
            int index = 0;

            if (args.Length > index)
            {
                chosenneighbourhood = args[index]; //index 0
                index++;
                //SceneManager.PopSceneFromStack();
                SceneManager.ChangeScene("Button3Scene");
                data1 = DataAccess.dataAccess.TheftPMonthInNeighbourhood(chosenneighbourhood);
                data2 = DataAccess.dataAccess.BoxPNeighbourhood();
                Duodata <string, int> temp = new Duodata <string, int>("", 0);
                foreach (Duodata <string, int> i in data2)
                {
                    if (i.GetAttr1() == chosenneighbourhood)
                    {
                        temp = i;
                    }
                }
                data2 = new List <Duodata <string, int> >();
                for (int i = 0; i < data1.Count; i++)
                {
                    data2.Add(new Duodata <string, int>(data1[i].GetAttr1(), temp.GetAttr2()));
                }

                GroupedBarchart = null;
                Legend          = null;
            }
        }
Ejemplo n.º 2
0
        //Create scene for Button 1
        public Button1Scene(GraphicsDevice graphDevice, string ID) : base(graphDevice, ID)
        {
            data = DataAccess.dataAccess.BoxPNeighbourhood();

            Duodata <string, int> one, two, three, four, five;

            one   = new Duodata <string, int>("", -1);
            two   = new Duodata <string, int>("", -1);
            three = new Duodata <string, int>("", -1);
            four  = new Duodata <string, int>("", -1);
            five  = new Duodata <string, int>("", -1);

            foreach (Duodata <string, int> i in data)
            {
                if (i.GetAttr2() > one.GetAttr2())
                {
                    one = i;
                }
            }

            foreach (Duodata <string, int> i in data)
            {
                if (i.GetAttr2() > two.GetAttr2())
                {
                    if (i != one)
                    {
                        two = i;
                    }
                }
            }
            foreach (Duodata <string, int> i in data)
            {
                if (i.GetAttr2() > three.GetAttr2())
                {
                    if (i != one && i != two)
                    {
                        three = i;
                    }
                }
            }
            foreach (Duodata <string, int> i in data)
            {
                if (i.GetAttr2() > four.GetAttr2())
                {
                    if (i != one && i != two && i != three)
                    {
                        four = i;
                    }
                }
            }
            foreach (Duodata <string, int> i in data)
            {
                if (i.GetAttr2() > five.GetAttr2())
                {
                    if (i != one && i != two && i != three && i != four)
                    {
                        five = i;
                    }
                }
            }
            data = new List <Duodata <string, int> >();
            data.Add(one);
            data.Add(two);
            data.Add(three);
            data.Add(four);
            data.Add(five);
        }