Skip to content

Commit

Permalink
Feature: add params to constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tboefijn committed Mar 17, 2024
1 parent 0eb063c commit 56530a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Aplib.Core/Tactics/AnyOfTactic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AnyOfTactic : Tactic
/// Initializes a new instance of the <see cref="AnyOfTactic"/> class with the specified sub-tactics.
/// </summary>
/// <param name="subTactics">The list of sub-tactics.</param>
public AnyOfTactic(List<Tactic> subTactics)
public AnyOfTactic(params Tactic[] subTactics)
{
SubTactics = new();

Expand All @@ -32,7 +32,7 @@ public AnyOfTactic(List<Tactic> subTactics)
/// </summary>
/// <param name="subTactics">The list of sub-tactics.</param>
/// <param name="guard">The guard condition.</param>
public AnyOfTactic(List<Tactic> subTactics, Func<bool> guard) : this(subTactics) => Guard = guard;
public AnyOfTactic(Func<bool> guard, params Tactic[] subTactics) : this(subTactics) => Guard = guard;

/// <inheritdoc/>
public override Action? GetAction()
Expand Down
4 changes: 2 additions & 2 deletions Aplib.Core/Tactics/FirstOfTactic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class FirstOfTactic : AnyOfTactic
/// Initializes a new instance of the <see cref="FirstOfTactic"/> class with the specified sub-tactics.
/// </summary>
/// <param name="subTactics">The list of sub-tactics.</param>
public FirstOfTactic(List<Tactic> subTactics) : base(subTactics)
public FirstOfTactic(params Tactic[] subTactics) : base(subTactics)
{
}

Expand All @@ -21,7 +21,7 @@ public FirstOfTactic(List<Tactic> subTactics) : base(subTactics)
/// </summary>
/// <param name="subTactics">The list of sub-tactics.</param>
/// <param name="guard">The guard condition.</param>
public FirstOfTactic(List<Tactic> subTactics, Func<bool> guard) : base(subTactics, guard)
public FirstOfTactic(Func<bool> guard, params Tactic[] subTactics) : base(guard, subTactics)
{
}

Expand Down

0 comments on commit 56530a6

Please sign in to comment.