public CanvasPageViewModel() { ResetPage(); PaintingNumbers = new List<int> { 1, 2, 3,4,5,6}; CurrentPaintingNumber = PaintingNumbers[0]; LevelFinished = false; GameSpotsList = new GameHotSpots(); LeftPaintingName = @"Assets/paintings/" + PaintingNumbers[0] + "Left.JPG"; RightPaintingName = @"Assets/paintings/" + PaintingNumbers[0] + "Right.JPG"; CurrentPaintingSpots = new PaintingHotSpots(); CurrentPaintingSpots.Spots = new List<HotSpot>(); CurrentPaintingSpots.PaintingName = CurrentPaintingNumber + ""; var bounds = Window.Current.Bounds; ScreenHeight = bounds.Height; ScreenWidth = bounds.Width; ScreenHeightNeg = bounds.Height*-1; ScreenWidthNeg = bounds.Width*-1; CanvasHeight = ScreenHeight * 80 /100; CanvasWidth = ScreenWidth * 48 / 100; HintsLeft = 3; }
private void AddCurrentPaintingToGameSpotsList(PaintingHotSpots currentSpots) { if (!CreateGameMode) { return; } if (_viewModel.GameSpotsList == null) { _viewModel.GameSpotsList = new GameHotSpots(); } if (_viewModel.GameSpotsList.PaintingSpots == null) { _viewModel.GameSpotsList.PaintingSpots = new List<PaintingHotSpots>(); } foreach (var painting in _viewModel.GameSpotsList.PaintingSpots) { if (!string.IsNullOrEmpty(painting.PaintingName) && painting.PaintingName.Equals(currentSpots.PaintingName)) { return; } } _viewModel.GameSpotsList.PaintingSpots.Add(currentSpots); }
public void LoadCurrentPaintingHotSpots(int index) { var found = false; if (GameSpotsList != null && GameSpotsList.PaintingSpots != null && GameSpotsList.PaintingSpots.Count >= index) { foreach (var spot in GameSpotsList.PaintingSpots) { if (spot.PaintingName == index + "") { CurrentPaintingSpots = GameSpotsList.PaintingSpots[index-1]; found = true; break; } } } if (!found) { CurrentPaintingSpots = new PaintingHotSpots(); CurrentPaintingSpots.PaintingName = index + ""; } }