-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add metadata to Goals and Tactics * feat: add metadata to Actions * test: Tactic metadata * test: Action metadata * fix: metadata property doc comments * feat: let the constructors of goals and actions take a metadata object, instead of a raw name and description * feat: let the constructors of tactics take a metadata object, instead of a raw name and description * feat: add a unique identifier to component metadata * feat: make metadata optional for goals * feat: make metadata optional for actions * feat: make metadata optional for tactics * test: metadata identifiers * feat: give `Metadata` a ctor that takes an id, for testing * test: remove unnecessary tests * fix: fix overlapping signature * chore: change visibility of parameterless constructor --------- Co-authored-by: Jens Steenmetz <[email protected]>
- Loading branch information
1 parent
29c0a94
commit 553533f
Showing
14 changed files
with
269 additions
and
49 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
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
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,47 @@ | ||
using System; | ||
|
||
namespace Aplib.Core | ||
{ | ||
/// <summary> | ||
/// Data structure to store information about a component which may be useful for debugging or logging. | ||
/// </summary> | ||
public class Metadata | ||
{ | ||
/// <summary> | ||
/// Gets the unique identifier of the component. | ||
/// </summary> | ||
public Guid Id { get; } | ||
|
||
/// <summary> | ||
/// Gets the name used to display the component during debugging, logging, or general overviews. | ||
/// </summary> | ||
public string? Name { get; } | ||
|
||
/// <summary> | ||
/// Gets the description used to describe the component during debugging, logging, or general overviews. | ||
/// </summary> | ||
public string? Description { get; } | ||
|
||
/// <summary> | ||
/// Store information about a component which may be useful for debugging or logging or general overviews. | ||
/// </summary> | ||
/// <param name="name">The name used to display the component.</param> | ||
/// <param name="description">The description used to describe the component.</param> | ||
public Metadata(string? name = null, string? description = null) | ||
{ | ||
Id = Guid.NewGuid(); | ||
Name = name; | ||
Description = description; | ||
} | ||
|
||
/// <summary> | ||
/// Store information about a component which may be useful for debugging or logging or general overviews. | ||
/// </summary> | ||
/// <remarks>This constructor is mainly for testing.</remarks> | ||
/// <param name="id">A unique identifier for the component.</param> | ||
/// <param name="name">The name used to display the component.</param> | ||
/// <param name="description">The description used to describe the component.</param> | ||
internal Metadata(Guid id, string? name = null, string? description = null) | ||
: this(name, description) => Id = id; | ||
} | ||
} |
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
Oops, something went wrong.