protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //this.OverridePendingTransition(Resource.Animation.SlideInRight, Resource.Animation.SlideOutLeft); this.Window.AddFlags(WindowManagerFlags.Fullscreen); /*ActionBar.SetDisplayHomeAsUpEnabled(false); * ActionBar.SetDisplayShowHomeEnabled(false);*/ var par = (RelativeLayout.LayoutParams)_btnClose.LayoutParameters; par.AddRule(LayoutRules.AlignParentRight, 0); par.AddRule(LayoutRules.AlignParentLeft); _btnClose.LayoutParameters = par; _Mappa = JsonConvert.DeserializeObject <Mappa>(Intent.GetStringExtra("mappa")); //(Mappa)ActivitiesBringe.GetObject(); _MapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment; if (_MapFragment == null) { GoogleMapOptions mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeNormal) .InvokeZoomControlsEnabled(false) .InvokeCompassEnabled(true); FragmentTransaction fragTx = FragmentManager.BeginTransaction(); _MapFragment = MapFragment.NewInstance(mapOptions); fragTx.Add(_contentView.Id, _MapFragment, "map"); fragTx.Commit(); } SetupMapIfNeeded(); }
public AdmiralAndrea() { InizializzaNavi(); mappaGiocatore = new Mappa(DIMENSIONEMAPPA); mappaAvversario = new Mappa(DIMENSIONEMAPPA); //PosizionaFlotta(); //?? da inserire nel costruttore o no?? }
private async void centerMap(double[] coordinate) { System.Diagnostics.Debug.WriteLine("CENTRO"); Geopoint location = new Geopoint(new BasicGeoposition() { Latitude = coordinate[0], Longitude = coordinate[1] }); await Mappa.TrySetViewAsync(location, 15); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #region Inizializzazioni //Inizializzazioni const int RIGHE = 3; const int COLONNE = 5; string[,] materiali = new string[RIGHE, COLONNE]; string[,] nomi = new string[RIGHE, COLONNE]; string[] listaMateriali = { "MaterialeComune", "MaterialeRaro", "MaterialePrezioso" }; string[] listaNomi = { "Cuneo", "Abbiategrasso", "Abbiatelardo", "Taranto", "Scampia", "Bolzano", "Ghiffa", "Palermo", "Miazzina", "Catanzaro", "Luino", "Alba", "Calascibetta", "Ribera", "Kyoto", "Costantinopoli", "Finterra","Calbarico" }; Random rng = new Random(); //Materiali for (int j = 0; j < materiali.GetLength(1); j++) { for (int i = 0; i < materiali.GetLength(0); i++) { materiali[i, j] = listaMateriali[rng.Next() % listaMateriali.Length]; } } //Nomi for (int j = 0; j < nomi.GetLength(1); j++) { for (int i = 0; i < nomi.GetLength(0); i++) { int indice = 0; do { indice = rng.Next() % listaNomi.Length; nomi[i, j] = listaNomi[indice]; }while (listaNomi[indice] == " "); listaNomi[indice] = " "; } } Mappa = new Mappa(materiali, nomi); #endregion Application.Run(new Form1(Mappa)); }
private async void centerMap(bool refresh) { if (refresh) { await getUserLocation(); if (location == null) { MessageDialog msgbox = new MessageDialog("La posizione è disattivata. Attiva i dati di posizione dalle impostazioni del telefono."); msgbox.Title = "Posizione disattivata"; await msgbox.ShowAsync(); return; } } await Mappa.TrySetViewAsync(location, 15); }
public MappaView(Context context, Mappa map, ViewerScreen docView) : base(context) { _mappa = map; _docView = docView; //LoadMap(); GoogleMapOptions mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeNormal) .InvokeZoomControlsEnabled(false) .InvokeCompassEnabled(true); _mapView = new MapView(context, mapOptions); this.AddView(_mapView); _mapView.OnCreate(null); _mapView.OnResume(); _googleMap = _mapView.Map; SetupMapIfNeeded(); }
protected override async void OnAppearing() { Position position = new Position(41.902782, 12.496366); MapSpan mapSpan = new MapSpan(position, 11, 13); Mappa.MoveToRegion(mapSpan); List <Coordinate> lista = Classe_supporto.listaposizioneregioni; foreach (var item in lista) { Polygon polygon = new Polygon { StrokeWidth = 4, StrokeColor = Color.FromHex("#424242"), FillColor = Color.FromHex(await Ottienicolore.getcodicecolereg(item.nome)) }; foreach (var item2 in item.posizioni) { polygon.Geopath.Add(new Position(item2.Latitude, item2.Longitude)); } Mappa.MapElements.Add(polygon); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //this.OverridePendingTransition(Resource.Animation.SlideInRight, Resource.Animation.SlideOutLeft); this.Window.AddFlags(WindowManagerFlags.Fullscreen); /*ActionBar.SetDisplayHomeAsUpEnabled(false); * ActionBar.SetDisplayShowHomeEnabled(false);*/ var par = (RelativeLayout.LayoutParams)_btnClose.LayoutParameters; par.AddRule(LayoutRules.AlignParentRight, 0); par.AddRule(LayoutRules.AlignParentLeft); _btnClose.LayoutParameters = par; _Mappa = JsonConvert.DeserializeObject <Mappa>(Intent.GetStringExtra("mappa")); //(Mappa)ActivitiesBringe.GetObject(); LoadMap(); //SetupMapIfNeeded(); DownloadKML(); }
public Form1(Mappa mappa) { InitializeComponent(); formProduzione = new GestioneEdificio(); gestioneTrasporti = new GestioneTrasporti(); formTrasporti = new FormTrasporti(); menuViaggio = new CreazioneViaggio(gestioneTrasporti); giocatore = new Giocatore(500, 5, 10); LordoTotale.Text = "Lordo: " + giocatore.portafogli.Reddito + "$"; SpeseTotali.Text = "Spese: " + giocatore.portafogli.Spese + "$"; GuadagnoGiornaliero.Text = "Guadagno giornaliero: " + giocatore.portafogli.Bilancio + "$"; portafoglio_label.Text = "Portafoglio: " + giocatore.portafogli.Soldi + "$"; immagineAzienda_label.Text = "Immagine azienda: " + giocatore.FamaAziendale + "/10"; richiesteLavoro_label.Text = "Richieste lavoro: " + giocatore.DipendentiDisponibili; #region InizializzazioneMappa this.mappa = mappa; griglia = new PictureBox[3, 5] { { cell1, cell2, cell3, cell4, cell5 }, { cell6, cell7, cell8, cell9, cell10 }, { cell11, cell12, cell13, cell14, cell15 } }; luoghi = new Label[3, 5] { { luogo1, luogo2, luogo3, luogo4, luogo5 }, { luogo6, luogo7, luogo8, luogo9, luogo10 }, { luogo11, luogo12, luogo13, luogo14, luogo15 } }; attenzione = new PictureBox[3, 5] { { attenzione1, attenzione2, attenzione3, attenzione4, attenzione5 }, { attenzione6, attenzione7, attenzione8, attenzione9, attenzione10 }, { attenzione11, attenzione12, attenzione13, attenzione14, attenzione15 } }; //Materiale sottostante for (int j = 0; j < griglia.GetLength(1); j++) { for (int i = 0; i < griglia.GetLength(0); i++) { if (mappa.CelleMateriali[i, j] == "MaterialeComune") { griglia[i, j].BackgroundImage = Properties.Resources.comuni; } else if (mappa.CelleMateriali[i, j] == "MaterialePrezioso") { griglia[i, j].BackgroundImage = Properties.Resources.preziosi; } else if (mappa.CelleMateriali[i, j] == "MaterialeRaro") { griglia[i, j].BackgroundImage = Properties.Resources.rari; } } } //Nomi città for (int i = 0; i < griglia.GetLength(0); i++) { for (int j = 0; j < griglia.GetLength(1); j++) { luoghi[i, j].Text = mappa.CelleNomi[i, j]; } } #endregion }
//private List<string> rapportiSpari; public AdmiralAlessio() { map = new Mappa(); //rapportiSpari = new List<string>(); }
/// <summary> /// Inizializzatore missione. /// Mostra form, inizializza i nemici, posiziona il giocatore /// </summary> public void StartMissione() { Mappa.Show(); //TODO: Altro codice necessario all'avvio corretto della missione }
/// <summary> /// Terminatore missione. /// Esegue il dispose dei Form e libera le risorse /// </summary> public void EndMissione() { //TODO: Da il reward e contrassegna la missione come completata sulla cartina Fine.Dispose(); Mappa.Dispose(); }