public static Piece ReloadPiece(string name) { var existingPiece = Pieces.FirstOrDefault(p => p.InnerName == name); if (existingPiece != null) { Pieces.Remove(existingPiece); } var path = FileExplorer.FindPath(FileExplorer.Pieces, name, ".yaml"); var nodes = TextNodeLoader.FromFile(path, name + ".yaml"); var piece = new Piece(name, path, nodes); Pieces.Add(piece); return(piece); }
void savePiece() { PieceSaver.SaveWorld(game.World, FileExplorer.FindPath(FileExplorer.Pieces, game.MapType.OverridePiece, ".yaml"), game.MapType.OverridePiece); game.AddInfoMessage(150, "Map saved!"); }