From 4fae0158edd2f809b145ccacf20f082c06cd4a3e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 24 Apr 2020 17:49:25 -0400 Subject: add map patching API Migrated from the Content Patcher code. I'm the main author, with tile property merging based on contributions by hatrat. --- src/SMAPI/IAssetDataForMap.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/SMAPI/IAssetDataForMap.cs (limited to 'src/SMAPI/IAssetDataForMap.cs') diff --git a/src/SMAPI/IAssetDataForMap.cs b/src/SMAPI/IAssetDataForMap.cs new file mode 100644 index 00000000..769ca07c --- /dev/null +++ b/src/SMAPI/IAssetDataForMap.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using xTile; + +namespace StardewModdingAPI +{ + /// Encapsulates access and changes to map content being read from a data file. + public interface IAssetDataForMap : IAssetData + { + /********* + ** Public methods + *********/ + /// Copy layers, tiles, and tilesheets from another map onto the asset. + /// The map from which to copy. + /// The tile area within the source map to copy, or null for the entire source map size. This must be within the bounds of the map. + /// The tile area within the target map to overwrite, or null to patch the whole map. The original content within this area will be erased. This must be within the bounds of the existing map. + public void PatchMap(Map source, Rectangle? sourceArea = null, Rectangle? targetArea = null); + } +} -- cgit