public void End() { AppShell.RemoveAllFlyoutItems(); LengthOfThisGame = StartingTime - DateTime.UtcNow; var EndInfo = new IntroductionViewModel(AppShell, "Konec"); if (LengthOfThisGame.Minutes <= Model.Limit.Minutes) { var EndText = new Text() { Title = "Úspěšně jsi dokončil hru", OwnText = "Hra ti trvala " + LengthOfThisGame.Minutes + " minut. " + "Limit byl " + Model.Limit.Minutes + " minut.", PositionInIntroduction = 0 }; EndInfo.AddText(EndText); } else { var EndText = new Text() { Title = "Hru jsi nestihnul v limitu", OwnText = "Hra ti trvala " + LengthOfThisGame.Minutes + " minut. " + "Limit byl " + Model.Limit.Minutes + " minut.", PositionInIntroduction = 0 }; EndInfo.AddText(EndText); } }
public async void LoadAndPlayGame(int id, AppShell appShell) { var restClient = new RestClient.RestClient(); var gameResource = await restClient.GetFullGameByIdAsync(id); var converter = new FullGameConverter(); var game = converter.Convert(gameResource); LocationChecker = new LocationChecker(); AppShell = appShell; Model = game; MapService = new MapService(AppShell); Introduction = new IntroductionViewModel(AppShell, Model.Introduction.Title); if (Model.Introduction.DisplayObjects != null) { foreach (DisplayObject obj in Model.Introduction.DisplayObjects) { Introduction.AddDisplayObject(obj); } } Text InfoAboutGame = new Text() { Title = "Hráči, kteří se podíleli na této hře", PositionInIntroduction = 0, OwnText = "" }; foreach (User user in Model.Owners) { InfoAboutGame.OwnText = InfoAboutGame.OwnText + user.UserName + " "; } Introduction.AddText(InfoAboutGame); if (Model.Introduction.MapPositions != null) { MapService.AddNotStops(Model.Introduction.MapPositions as List <MapPosition>); } StartingTime = DateTime.UtcNow; foreach (Stop stop in Model.Stops) { SetUpStopModel(stop); } }
public async Task <IActionResult> Introduction(string challengeId, string questionId) { if (string.IsNullOrEmpty(challengeId) || string.IsNullOrEmpty(questionId)) { return(View("Index")); } var challenge = await challengesProvider.GetItemAsync(challengeId); var model = new IntroductionViewModel() { Id = challenge.Item2.Id, Duration = challenge.Item2.Duration, Name = challenge.Item2.Name, PrereqLinks = challenge.Item2.PrereqLinks, WelcomeMessage = challenge.Item2.WelcomeMessage, FirstQuestion = questionId }; return(View(model)); }
public IntroPage(IntroductionViewModel intro) { InitializeComponent(); this.BindingContext = intro; }
public IntroductionWindow(IntroductionViewModel viewModel) { InitializeComponent(); DataContext = viewModel; }