/// <summary> /// Fills the selectable tile textures with textures from tileset /// </summary> private void FillSelectableTileTextures() { if (_tilesetLoader.Tileset == null) { return; } var source = ImageSourceForBitmap(_tilesetLoader.Tileset); for (int i = 0; i < _tilesetLoader.TileBitmaps.Count; i++) { Int32Rect rect = new Int32Rect { X = ((Rectangle)_tilesetLoader.TileBitmaps[i]).X, Y = ((Rectangle)_tilesetLoader.TileBitmaps[i]).Y, Width = ((Rectangle)_tilesetLoader.TileBitmaps[i]).Width, Height = ((Rectangle)_tilesetLoader.TileBitmaps[i]).Height }; SelectableTileTextures.Add(new TileTextureItem(i, rect, source)); } }
/// <summary> /// Updates the editor with new values /// </summary> private void UpdateEditor() { _mapLoader.ResetEditor(); SelectableTileTextures.Clear(); FillSelectableTileTextures(); }