// Start is called before the first frame update private void Start() { currentMap = MAPS.BRIDGE; transform.GetChild((int)currentMap).gameObject.SetActive(true); script = GameObject.FindGameObjectWithTag("Animal_Chooser").GetComponent <AnimalsChoose>(); }
public async Task <IHttpActionResult> GetDirection([FromUri] TravelModel dto) { var direction = MAPS.GetDirection(dto.Origin, dto.Destiny); if (!direction.StatusOk) { throw new Exception("Rota não existe ou não foi encontrada"); } return(Ok(new { direction.Distance, direction.Duration, direction.DurationValue, direction.Destiny, direction.Origin, StartAddress = new Locatization() { Lat = direction.Start.Lat, Long = direction.Start.Long, }, EndAddress = new Locatization() { Lat = direction.End.Lat, Long = direction.End.Long, }, direction.StatusOk, direction.Copyrights })); }
public static MAPS[] BindMapMarker() { DataSet ds = new DataSet(); DataTable dt = new DataTable(); List <MAPS> lstMarkers = new List <MAPS>(); try { dt.Columns.Add("LocationName"); dt.Columns.Add("Latitude"); dt.Columns.Add("Longitude"); dt.Rows.Add("LocationName 1", "23.722449", "90.401508"); dt.Rows.Add("LocationName 2", "23.715667", "90.384295"); dt.Rows.Add("LocationName 3", "23.723928", "90.405924"); dt.Rows.Add("LocationName 4", "23.716426", "90.395794"); dt.Rows.Add("LocationName 5", "23.721985", "90.399379"); foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.LocationName = dtrow[0].ToString(); objMAPS.Latitude = dtrow[1].ToString(); objMAPS.Longitude = dtrow[2].ToString(); lstMarkers.Add(objMAPS); } } catch (Exception ex) { throw ex; } return(lstMarkers.ToArray()); }
public void OnRecv(CPacket msg) { // 제일 먼저 프로토콜 아이디를 꺼내온다. PROTOCOL protocol_id = (PROTOCOL)msg.pop_protocol_id(); Debug.Log("on message " + protocol_id); // 프로토콜에 따른 분기 처리. switch (protocol_id) { case PROTOCOL.START_LOADING: byte player_index = msg.pop_byte(); MAPS map = (MAPS)msg.pop_byte(); int initGold = msg.pop_int32(); Deck deck = new Deck(); for (int i = 0; i < Constants.BUILDING_PER_DECK; i++) { deck.AddToDeck(new Card((BuildingType)msg.pop_byte())); Debug.Log("EnemyDeck Recved :" + deck[i].CardType); } //string ipEndPoint = msg.pop_string(); switch (map) { case MAPS.DESERT: Debug.Log("Load Desert"); SceneManager.LoadScene("Desert"); break; } this.battle_room.gameObject.SetActive(true); this.battle_room.LoadBattle(player_index, map, initGold, deck); gameObject.SetActive(false); break; } }
public void changeMap(int change) { if (change + (int)currentMap >= (int)MAPS.BRIDGE && change + (int)currentMap < maps.Length) { currentMap += change; selectMap((int)currentMap); } }
public GameMap GetMap(MAPS map_type, int width, int height) { switch(map_type) { case MAPS.FOREST_PATH: return new GameMapForest(width, height); default: throw new NotImplementedException(); } }
public MAPS[] init_get_car() { List <MAPS> lstMarkers = new List <MAPS>(); connections con = new connections(); DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); dt.Columns.Add("lat"); dt.Columns.Add("lon"); dt.Columns.Add("type"); ds1 = con.FN_ExecuteQuerySingle("select lat,lon from Car_LAT_LON"); if (ds1.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { DataRow dr = dt.NewRow(); dr["lat"] = ds1.Tables[0].Rows[i]["lat"].ToString(); dr["lon"] = ds1.Tables[0].Rows[i]["lon"].ToString(); dt.Rows.Add(dr); } } else { DataRow dr = dt.NewRow(); dr["lat"] = "23.235846"; dr["lon"] = "77.3980373"; dr["type"] = "D"; dt.Rows.Add(dr); } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.lat = dtrow[0].ToString(); objMAPS.lon = dtrow[1].ToString(); objMAPS.type = dtrow[2].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); }
/// <summary> /// Implements the OnDisconnection method of the IDTExtensibility2 interface. /// Receives notification that the Add-in is being unloaded. /// </summary> /// <param term='disconnectMode'> /// Describes how the Add-in is being unloaded. /// </param> /// <param term='custom'> /// Array of parameters that are host application specific. /// </param> /// <seealso class='IDTExtensibility2' /> public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom) { addInInstance = null; PLACES.Destroy(); MAPS.Destroy(); PROJECTS.Destroy(); ABOUT.Destroy(); DocumentStorage.Destroy(); MMUtils.MindManager = null; m_myTab.Delete(); m_myTab = null; System.GC.Collect(); }
public void LoadBattle(byte playerIndex, MAPS map, int initGold, Deck opponentDeck) { Debug.Log("CBattleRoom LoadBattle"); buildManager.gameObject.SetActive(true); playerMeIndex = playerIndex; this.map = map; this.initGold = initGold; this.networkManager.messageReceiver = this; DeckManager.instance.opponentDeck = opponentDeck; CPacket msg = CPacket.create((short)PROTOCOL.LOADING_COMPLETED); this.networkManager.send(msg); this.gameState = GAME_STATE.READY; }
public async Task <IHttpActionResult> GetMaps([FromUri] TravelModel dto) { var route = MAPS.SearchMap(dto.Origin, dto.Destiny); if (route.IsError) { throw new Exception("Rota não existe ou não foi encontrada"); } return(Ok(new { route.Destiny, route.TotalKm, route.Duration, route.Origin, })); }
public MAPS[] fn_get_car(string lat, string lon) { List <MAPS> lstMarkers = new List <MAPS>(); connections con = new connections(); DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); dt.Columns.Add("lat"); dt.Columns.Add("lon"); ds = con.FN_ExecuteQuerySingle("insert into Car_LAT_LON (lat,lon) values('" + lat + "','" + lon + "')"); ds1 = con.FN_ExecuteQuerySingle("select lat,lon from Car_LAT_LON"); if (ds1.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { DataRow dr = dt.NewRow(); dr["lat"] = ds1.Tables[0].Rows[i]["lat"].ToString(); dr["lon"] = ds1.Tables[0].Rows[i]["lon"].ToString(); dt.Rows.Add(dr); } } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.lat = dtrow[0].ToString(); objMAPS.lon = dtrow[1].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); }
public static MAPS[] BindMapPoints(string name, string name1) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); List <MAPS> lstFencingCircle = new List <MAPS>(); try { dt.Columns.Add("Latitude"); dt.Columns.Add("Longitude"); dt.Rows.Add("14.6024595263", "-90.3413091974"); dt.Rows.Add("14.6034629969", "-90.3414106076"); dt.Rows.Add("14.6078011922", "-90.3401542519"); dt.Rows.Add("14.6088475707", "-90.3368858258"); dt.Rows.Add("14.604717034", "-90.3377615063"); dt.Rows.Add("14.6037954647", "-90.3384398257"); dt.Rows.Add("14.6033980053", "-90.3388578318"); dt.Rows.Add("14.6028021398", "-90.3400000371"); dt.Rows.Add("14.6025948001", "-90.3408263767"); dt.Rows.Add("14.6024595263", "-90.3413091974"); dt.Rows.Add("14.6024595263", "-90.3413091974"); foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.Latitude = dtrow["Latitude"].ToString(); objMAPS.Longitude = dtrow["Longitude"].ToString(); lstFencingCircle.Add(objMAPS); } } catch (Exception ex) { throw ex; } return(lstFencingCircle.ToArray()); }
public static MAPS[] get_routes(string m, string route) { List <MAPS> lstMarkers = new List <MAPS>(); DataSet ds = new DataSet(); business ob = new business(); connections con = new connections(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); DataTable dt12 = new DataTable(); dt.Columns.Add("BinName"); dt.Columns.Add("lat"); dt.Columns.Add("lon"); dt.Columns.Add("BinId"); dt.Columns.Add("Bin_Type"); dt.Columns.Add("Priority"); if (m == "1") { ds = ob.fn_get_routes_for_bin(m, route); } try { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++)//binding bins { DataRow dr = dt.NewRow(); dr["BinId"] = ds.Tables[0].Rows[i]["BinId"].ToString(); dr["BinName"] = ds.Tables[0].Rows[i]["BinName"].ToString(); dr["lat"] = ds.Tables[0].Rows[i]["Latitude"].ToString(); dr["lon"] = ds.Tables[0].Rows[i]["Longitude"].ToString(); dr["Bin_Type"] = ds.Tables[0].Rows[i]["Type"].ToString(); dr["Priority"] = ds.Tables[0].Rows[i]["Priority"].ToString(); dt.Rows.Add(dr); } } } catch { } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.BinId = dtrow[3].ToString(); objMAPS.lat = dtrow[1].ToString(); objMAPS.lon = dtrow[2].ToString(); objMAPS.BinName = dtrow[0].ToString(); objMAPS.Type = dtrow[4].ToString(); objMAPS.SPriority = dtrow[5].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); }
public Map(MAPS map) { this.Type = map; Initialize(); }
public static MAPS[] ConvertDataTabletoString(string s, string zone, string ward, string type, string rid) { List <MAPS> lstMarkers = new List <MAPS>(); DataSet ds = new DataSet(); business ob = new business(); connections con = new connections(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); dt.Columns.Add("AreaName"); dt.Columns.Add("lat"); dt.Columns.Add("lon"); dt.Columns.Add("BinId"); dt.Columns.Add("Bin_Type"); dt.Columns.Add("Priority"); dt.Columns.Add("routeid"); dt.Columns.Add("status"); try { if (s == "1") { ds = ob.fn_get_bin_routewise(s, zone, ward, type, rid);//all bin bind } } catch { } try { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++)//binding bins { DataRow dr = dt.NewRow(); dr["BinId"] = ds.Tables[0].Rows[i]["BinId"].ToString(); dr["AreaName"] = ds.Tables[0].Rows[i]["BinName"].ToString(); dr["lat"] = ds.Tables[0].Rows[i]["Latitude"].ToString(); dr["lon"] = ds.Tables[0].Rows[i]["Longitude"].ToString(); dr["Bin_Type"] = ds.Tables[0].Rows[i]["Type"].ToString(); dr["Priority"] = ds.Tables[0].Rows[i]["Priority"].ToString(); dr["routeid"] = ds.Tables[0].Rows[i]["routeid"].ToString(); dr["status"] = ds.Tables[0].Rows[i]["status"].ToString(); dt.Rows.Add(dr); } } } catch { } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.AreaName = dtrow[0].ToString(); objMAPS.lat = dtrow[1].ToString(); objMAPS.lon = dtrow[2].ToString(); objMAPS.BinId = dtrow[3].ToString(); objMAPS.Bin_Type = dtrow[4].ToString(); objMAPS.Priority = dtrow[5].ToString(); objMAPS.routeid = dtrow[6].ToString(); objMAPS.status = dtrow[7].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); //return serializer.Serialize(rows); }
public static MAPS[] ConvertDataTabletoString(string s, string zone, string ward, string type) { List <MAPS> lstMarkers = new List <MAPS>(); DataSet dslocation = new DataSet(); DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); business ob = new business(); DataTable dt1 = new DataTable(); DataSet dsbinid = new DataSet(); connections con = new connections(); map_procedures mp = new map_procedures(); DataSet getPU = new DataSet(); DataSet select = new DataSet(); string jam = string.Empty; DataSet get_PU_zn_ws = new DataSet(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); DataTable dt12 = new DataTable(); dt.Columns.Add("AreaName"); dt.Columns.Add("lat"); dt.Columns.Add("lon"); dt.Columns.Add("BinId"); dt.Columns.Add("Bin_Type"); dt.Columns.Add("Priority"); if (s == "1") { ds = ob.fn_map_bind(s, zone, ward, type);//all bin bind } else if (s == "2") { ds1 = ob.fn_feeders_bind(s, zone, ward);//only feeders s,zone,ward } else if (s == "3") { getPU = ob.fn_get_PU(s, zone, ward);//only processing units } else { ds = ob.fn_map_bind(s, zone, ward, type); //for binding bins getPU = ob.fn_get_PU(s, zone, ward); //for binding Processing points ds1 = ob.fn_feeders_bind(s, zone, ward); //for binding feeders points } try { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++)//binding bins { DataRow dr = dt.NewRow(); dr["BinId"] = ds.Tables[0].Rows[i]["BinId"].ToString(); dr["AreaName"] = ds.Tables[0].Rows[i]["BinName"].ToString(); dr["lat"] = ds.Tables[0].Rows[i]["Latitude"].ToString(); dr["lon"] = ds.Tables[0].Rows[i]["Longitude"].ToString(); dr["Bin_Type"] = ds.Tables[0].Rows[i]["Type"].ToString(); dr["Priority"] = ds.Tables[0].Rows[i]["Priority"].ToString(); dt.Rows.Add(dr); } } } catch { } try { if (ds1.Tables[0].Rows.Count > 0)//feeders { for (int j = 0; j < ds1.Tables[0].Rows.Count; j++) { DataRow dr1 = dt.NewRow(); dr1["lat"] = ds1.Tables[0].Rows[j]["lat"].ToString(); dr1["lon"] = ds1.Tables[0].Rows[j]["lon"].ToString(); dr1["AreaName"] = ds1.Tables[0].Rows[j]["FeederName"].ToString(); dr1["Bin_Type"] = ds1.Tables[0].Rows[j]["Type"].ToString(); dt.Rows.Add(dr1); } } } catch { } try { if (getPU.Tables[0].Rows.Count > 0)//processing units { for (int k = 0; k < getPU.Tables[0].Rows.Count; k++) { DataRow dr2 = dt.NewRow(); dr2["lat"] = getPU.Tables[0].Rows[k]["lat"].ToString(); dr2["lon"] = getPU.Tables[0].Rows[k]["lon"].ToString(); dr2["AreaName"] = getPU.Tables[0].Rows[k]["name"].ToString(); dr2["Bin_Type"] = getPU.Tables[0].Rows[k]["Type"].ToString(); dt.Rows.Add(dr2); } } } catch { } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.AreaName = dtrow[0].ToString(); objMAPS.lat = dtrow[1].ToString(); objMAPS.lon = dtrow[2].ToString(); //objMAPS.Areaid = dtrow[0].ToString(); objMAPS.Bin_Type = dtrow[4].ToString(); objMAPS.BinId = dtrow[3].ToString(); objMAPS.Priority = dtrow[5].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); //return serializer.Serialize(rows); }
public static MAPS[] get_current_route(string s, string binid) { List <MAPS> lstMarkers = new List <MAPS>(); DataSet ds = new DataSet(); business ob = new business(); DataTable dt = new DataTable(); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); dt.Columns.Add("BinName"); dt.Columns.Add("lat"); dt.Columns.Add("lon"); dt.Columns.Add("routeid"); if (s == "1") { ds = ob.fn_get_current_bin(s, binid); } try { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++)//binding bins { DataRow dr = dt.NewRow(); dr["BinName"] = ds.Tables[0].Rows[i]["BinName"].ToString(); dr["lat"] = ds.Tables[0].Rows[i]["Latitude"].ToString(); dr["lon"] = ds.Tables[0].Rows[i]["Longitude"].ToString(); dr["routeid"] = ds.Tables[0].Rows[i]["routeid"].ToString(); dt.Rows.Add(dr); } } } catch { } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.lat = dtrow[1].ToString(); objMAPS.lon = dtrow[2].ToString(); objMAPS.BinName = dtrow[0].ToString(); objMAPS.routeid = dtrow[3].ToString(); lstMarkers.Add(objMAPS); } return(lstMarkers.ToArray()); }
public static MAPS[] BindMapPoints(string name, string name1) { Cl_Poligono ClPoligono; Cl_Utilitarios ClUtilitarios; ClPoligono = new Cl_Poligono(); ClUtilitarios = new Cl_Utilitarios(); string InmuebleId = HttpContext.Current.Session["InmuebleId"].ToString(); string Tipo = HttpContext.Current.Session["Tipo"].ToString(); string Proceso = HttpContext.Current.Session["Proceso"].ToString(); DataSet dsPoligono = new DataSet(); if (Proceso == "1") { dsPoligono = ClPoligono.obtener_poligonos_Inmueble(Convert.ToInt32(InmuebleId)); } else if (Proceso == "2") { string Id = HttpContext.Current.Session["Id"].ToString(); dsPoligono = ClPoligono.obtener_poligonos_Bosque_Ambos(Convert.ToInt32(InmuebleId), Convert.ToInt32(Id), Convert.ToInt32(Tipo)); } else if (Proceso == "3") { string Id = HttpContext.Current.Session["Id"].ToString(); dsPoligono = ClPoligono.obtener_poligonos_Intervenir_Ambos(Convert.ToInt32(InmuebleId), Convert.ToInt32(Id), Convert.ToInt32(Tipo)); } else if (Proceso == "4") { string Id = HttpContext.Current.Session["Id"].ToString(); dsPoligono = ClPoligono.obtener_poligonos_Proteccion_Ambos(Convert.ToInt32(InmuebleId), Convert.ToInt32(Id), Convert.ToInt32(Tipo)); } else if (Proceso == "5") { string Id = HttpContext.Current.Session["Id"].ToString(); dsPoligono = ClPoligono.obtener_poligonos_Repoblacion_Ambos(Convert.ToInt32(Id), Convert.ToInt32(Tipo)); } List <MAPS> lstFencingCircle = new List <MAPS>(); for (int i = 0; i < dsPoligono.Tables["Datos"].Rows.Count; i++) { string[] puntos = dsPoligono.Tables["Datos"].Rows[i]["Poligono"].ToString().Split(' '); DataSet ds = new DataSet(); DataTable dt = new DataTable(); try { dt.Columns.Add("Latitude"); dt.Columns.Add("Longitude"); dt.Columns.Add("Tipo"); for (int j = 0; j < puntos.Length; j += 2) { string Lat = puntos[j]; string Long = puntos[j + 1]; dt.Rows.Add(Lat, Long); } foreach (DataRow dtrow in dt.Rows) { MAPS objMAPS = new MAPS(); objMAPS.Latitude = dtrow["Latitude"].ToString(); objMAPS.Longitude = dtrow["Longitude"].ToString(); objMAPS.Tipo = Tipo; objMAPS.Correlativo = (i + 1).ToString(); lstFencingCircle.Add(objMAPS); } } catch (Exception ex) { throw ex; } } dsPoligono.Clear(); return(lstFencingCircle.ToArray()); }