public async Task Test_download_image() { Route route = await MapQuest.GetRoute("Wien", "Tirol"); string id = await MapQuest.SaveImage(route); string p = "F:\\Studium\\SWE\\TourPlanner\\TourPlanner.Test\\bin\\Debug\\net5.0-windows\\Images\\" + id + ".jpg"; Assert.IsTrue(File.Exists(p)); }
// Use this for initialization public void openMap() { system = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GameController>(); if (Application.loadedLevelName != "thirtythree") { gameObject.SetActive(true); mapraw.SetActive(true); openingMap = true; StartCoroutine(blinking(mapDictionary[Application.loadedLevelName])); //objective Location currentQuest = system.getCurrentQuest(); if (currentQuest.GetType() == typeof(MapQuest)) { objectivePoint.SetActive(true); MapQuest temp = (MapQuest)currentQuest; objectivePointRectTransform.anchoredPosition = new Vector2(objectiveList[temp.getDestination()][0], objectiveList[temp.getDestination()][1]); } else { objectivePoint.SetActive(false); } //objectivePoint.SetActive(true); //Debug.Log(objectivePointRectTransform.anchoredPosition.x + " " + objectivePointRectTransform.anchoredPosition.y); //objectivePointRectTransform.anchoredPosition = new Vector2(objectiveList[2][0], objectiveList[2][1]); } else { //objective Location currentQuest = system.getCurrentQuest(); if (currentQuest.GetType() == typeof(MapQuest)) { objectivePoint.SetActive(true); MapQuest temp = (MapQuest)currentQuest; objectivePointRectTransform.anchoredPosition = new Vector2(objectiveList[temp.getDestination()][0], objectiveList[temp.getDestination()][1]); } else { objectivePoint.SetActive(false); } } }
//check to see that is player arrive at quest destination or not public bool IsArrive(int key) { bool arrived = false; if (currentQuest.GetType() == typeof(MapQuest)) { MapQuest temp = (MapQuest)currentQuest; arrived = temp.IsInDestination(key); } else if (currentQuest.GetType() == typeof(BossQuest)) { BossQuest temp = (BossQuest)currentQuest; arrived = temp.IsInDestination(key); } return(arrived); }
public void Initial() { /*FindingQuest temp = new FindingQuest(0, "Help Friend", "Go and rescue your friend", "incomplete", 100, 33); * temp.addItemQuest(new ItemQuest(1, "box", false, Spawn.one)); * temp.addItemQuest(new ItemQuest(2, "box", false, Spawn.one)); * temp.addItemQuest(new ItemQuest(3, "box", false, Spawn.one)); * temp.addItemQuest(new ItemQuest(4, "box", false, Spawn.one)); * temp.addMap(new int[]{5,11}); * temp.randomItems(); * temp.AddConversationMap(2, false); * questList.Add(0, temp); * * questList.Add(1, new MapQuest(1, "Find the way out", "Find the main door of the building", "incomplete", 30, 0, 33)); * * Quest temp2 = new Quest(2, "Contact authority", "Find the way to contact authority for help", "incomplete", 100); * temp2.AddConversationMap(5, false); * questList.Add(2, temp2); * * BossQuest temp3 = new BossQuest(3, "Fight the boss", "Go to the boss room and beat him", "incomplete", 200, 30, false); * temp3.AddConversationMap(30, false); * questList.Add(3, temp3);*/ //A00 - prologue MapQuest temp = new MapQuest(0, "Find the way out", "Avoid detection and escape from this place", "incomplete", 100, 0, 2); temp.AddConversationMap(1, false); temp.AddConversationMap(3, false); temp.AddConversationMap(4, false); temp.AddConversationMap(5, false); temp.AddConversationMap(10, false); questList.Add(0, temp); temp = new MapQuest(1, "A girl is the victim", "help a girl without alert ", "incomplete", 100, 4, 4); temp.AddConversationMap(3, false); questList.Add(1, temp); //A01 temp = new MapQuest(2, "Help your friends", "Investigate the cell room and help your friend", "incomplete", 200, 3, 21); temp.AddConversationMap(22, false); questList.Add(2, temp); //A02 temp = new MapQuest(3, "Find the useful information", "Go to the document room and find the useful information for escape", "incomplete", 100, 3, 12); temp.AddConversationMap(13, false); questList.Add(3, temp); //B01 temp = new MapQuest(4, "Contact Authority for help", "Sneak to the control room and find a way to contact authority", "incomplete", 300, 0, 10); temp.AddConversationMap(11, false); questList.Add(4, temp); //B02_1 temp = new MapQuest(5, "Find Amata", "Go to the destination point to see Amata", "incomplete", 100, 21, 17); temp.AddConversationMap(18, false); questList.Add(5, temp); //B02_2 temp = new MapQuest(6, "Searching for Amata", "Locate and find Amata", "incomplete", 100, 17, 13); temp.AddConversationMap(13, false); questList.Add(6, temp); //B03 FindingQuest temp2 = new FindingQuest(7, "Sabotage trafficker shipment", "Find the item for destroy the trafficker shipment", "incomplete", 400, 22); temp2.addItemQuest(new ItemQuest(1, "wood", false, Spawn.one)); temp2.addItemQuest(new ItemQuest(2, "wood", false, Spawn.one)); temp2.addItemQuest(new ItemQuest(3, "paper", false, Spawn.one)); temp2.addItemQuest(new ItemQuest(4, "paper", false, Spawn.one)); temp2.addItemQuest(new ItemQuest(5, "match", false, Spawn.one)); temp2.addMap(new int[] { 5, 7, 9, 20, 24 }); temp2.randomItems(); temp2.AddConversationMap(23, false); questList.Add(7, temp2); //C01 temp = new MapQuest(8, "Find the exit door", "Find the exit door to escape from this place", "incomplete", 200, 0, 35); temp.AddConversationMap(38, false); questList.Add(8, temp); //C02 BossQuest temp3 = new BossQuest(9, "Fight the boss", "Go to the boss room and beat him", "incomplete", 500, 30, false); temp3.AddConversationMap(30, false); questList.Add(9, temp3); //C03 temp = new MapQuest(10, "Find hiding place", "Find the room for hiding until authority arrived", "incomplete", 200, 10, 26); temp.AddConversationMap(27, false); questList.Add(10, temp); //A01sub1 }
public async Task Test_Save_Image_with_bad_Parameters() { Assert.IsNull(await MapQuest.SaveImage(new Route())); }
public async Task Test_Get_Route_with_bad_Parameters() { Route route = await MapQuest.GetRoute(null, ""); Assert.IsNull(route.sessionID); }