private void LoadMapScript() { MapScripts.Add(typeof(StartMapScript).Name, new StartMapScript()); MapScripts.Add(typeof(SwordSouthValleyMapScript).Name, new SwordSouthValleyMapScript()); MapScripts.Add(typeof(SouthValleyMazeScript).Name, new SouthValleyMazeScript()); MapScripts.Add(typeof(TestMapScript).Name, new TestMapScript()); }
public ShipTools(AccountModel account, string planetName) { this.account = account; var mainLayout = new StackLayout { BackgroundColor = Color.FromRgb(0, 0, 128), Children = { glyphinator } }; Content = mainLayout; if (Device.OS == TargetPlatform.iOS) { mainLayout.Padding = new Thickness(0, 20, 0, 0); } glyphinator.Clicked += async(sender, e) => { var systems = MapScripts.GetAllBodiesInRange30(account, 0, 0); }; this.Appearing += async(sender, e) => { planetID = (from b in account.Colonies where b.Value.Equals(planetName) select b.Key).First(); LoadBuildingsAsync(account, planetID); }; }
public MapMain() { Resources = Styles.Styles.StyleDictionary; Button cacheStarMapBtn = new Button { Text = "Cache Map", Style = (Style)Styles.Styles.StyleDictionary[Styles.Styles.StyleName.RegularButton.ToString()] //TextColor = Color.White, //BorderWidth = 2, //BorderColor = Color.White, //BackgroundColor = Color.Blue, //FontAttributes = FontAttributes.Bold }; var mainLayout = new StackLayout { BackgroundColor = Color.FromRgb(0, 0, 128), Children = { cacheStarMapBtn } }; Content = mainLayout; if (Device.OS == TargetPlatform.iOS) { mainLayout.Padding = new Thickness(0, 20, 0, 0); } this.Appearing += async(sender, e) => { AccountManagement.AccountManager accountMngr = new AccountManagement.AccountManager(); activeAccount = await accountMngr.GetActiveAccountAsync(); }; cacheStarMapBtn.Clicked += async(sender, e) => { var s = await MapScripts.GetAllStarsInRange300(activeAccount, 0, 0); Data.FileStorage.SaveStarsAsync(s); }; }