示例#1
0
文件: MapTest.cs 项目: joseph93/Genos
        public void addNodeTest()
        {
            try
            {
                Map map = new Map();
                Graph g = new Graph();
                Node n1 = new PointOfInterest(1, 0, 0, 1);
                Node n2 = new PointOfInterest(2, 0, 0, 1);

                List<Node> nodeList = new List<Node>();

                nodeList.Add(n1);
                nodeList.Add(n2);
                g.InsertNewVertex(n1);
                g.InsertNewVertex(n2);

                map.addNode(n1);
                map.addNode(n2);

                Graph mapGraph = map.getGraph();
                List<Node> mapNodes = map.GetPoiNodes();

                Assert.IsNotNull(nodeList);
                Assert.IsNotNull(g);
                Assert.IsNotNull(mapGraph);
                Assert.IsNotNull(mapNodes);

                Assert.Equals(nodeList, mapNodes);
                Assert.Equals(g, mapGraph);
            }
            catch (SecurityException e)
            {
                Console.WriteLine("Security Exception:\n\n{0}", e.Message);
            }
        }
示例#2
0
文件: MapTest.cs 项目: joseph93/Genos
        public void addNodeListTest()
        {
            try
            {
                Map map = new Map();
                Node n1 = new PointOfInterest(1, 0, 0, 1);
                Node n2 = new PointOfInterest(2, 0, 0, 1);

                List<Node> nodeList = new List<Node>();

                nodeList.Add(n1);
                nodeList.Add(n2);

                map.setPoiList(nodeList);

                List<Node> mapNodes = map.GetPoiNodes();

                Assert.IsNotNull(nodeList);
                Assert.IsNotNull(mapNodes);
                Assert.Equals(nodeList, mapNodes);
            }
            catch (SecurityException e)
            {
                Console.WriteLine("Security Exception:\n\n{0}", e.Message);
            }
        }
示例#3
0
    public IEnumerator startFreeRoaming()
    {
        yield return new WaitForSeconds(0.005f);

        ui_Manager = FindObjectOfType<UI_Manager>();

        floorManager = GameObject.Find("FloorManager");

        freeRoamingTour = FindObjectOfType<FreeRoaming>();
        mc = FindObjectOfType<MapController>();

        map = mc.getMap();

        iBeaconHandler bh = iBeaconHandler.GetComponent<iBeaconHandler>();
        List<Beacon> beacons = bh.getBeacons();

        DisplayFloor(2);

        map.initializeLists(arrayOfNodes);

        freeRoamingTour.setBeaconList(beacons);

        freeRoamingTour.initializeLists(map.GetPoiNodes());

        shortestPathCreator.transform.position = new Vector3(arrayOfNodes[0].transform.position.x, arrayOfNodes[0].transform.position.y, -7);
        /*public IEnumerator startStoryline()
        {
            yield return new WaitForSeconds(0.005f);

            ui_Manager = FindObjectOfType<UI_Manager>();
            floorManager = GameObject.Find("FloorManager");

            //Storyline demo = new Storyline(0, 1, "Demo Storyline", "Let's see how good is your mobile app!");

            mc = FindObjectOfType<MapController>();

            map = mc.getMap();

            iBeaconHandler bh = iBeaconHandler.GetComponent<iBeaconHandler>();
            List<Beacon> beacons = bh.getBeacons();
            int slID = PlayerPrefs.GetInt("storylineID");

            print("Storyline id is: " + slID);
            map.GetStoryline(slID).setBeaconList(beacons);

            List<Node> orderedPath = map.orderedPath(slID);

            //map.setStorypointList(orderedPath);
            map.startStoryline(orderedPath, slID);
            DisplayFloor(2, slID); //this should be the first floor

            map.GetStoryline(slID).getStorypointList()[0].setBeacon(new iBeaconServer("B9407F30-F5F8-466E-AFF9-25556B57FE6D", 38714, 26839));

            shortestPathCreator.transform.position = new Vector3(gameObjectNodesList[0].transform.position.x, gameObjectNodesList[0].transform.position.y, -7);
            */
    }