-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from KSP2Community/0.2.0
0.2.0
- Loading branch information
Showing
8 changed files
with
195 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/PatchManager.Parts/Attributes/ModuleDataAdapterAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace PatchManager.Parts.Attributes; | ||
|
||
/// <summary> | ||
/// Types that take this attribute must inherit from (ISelectable) and must have a constructor that takes the following arguments | ||
/// JObject - ModuleData.DataObject | ||
/// ModuleSelectable - Module | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class ModuleDataAdapterAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// The types this adapter is used for | ||
/// </summary> | ||
public readonly Type[] ValidTypes; | ||
/// <summary> | ||
/// Mark this class as a custom module data adapter | ||
/// </summary> | ||
/// <param name="validTypes">What data types it adapts</param> | ||
public ModuleDataAdapterAttribute(params Type[] validTypes) => ValidTypes = validTypes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters