< Summary

Class:ReleaseStrategyBase
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Release/ReleaseStrategyBase.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:24
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:4
Method coverage:0% (0 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ReleaseStrategyBase(...)0%2100%
Release()0%12300%

File(s)

/github/workspace/Assets/Scripts/Release/ReleaseStrategyBase.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3// Base implementation of a release strategy.
 4public abstract class ReleaseStrategyBase : IReleaseStrategy {
 05  public IAgent Agent { get; init; }
 6
 07  public ReleaseStrategyBase(IAgent agent) {
 08    Agent = agent;
 09  }
 10
 11  // Release the sub-interceptors.
 012  public List<IAgent> Release() {
 013    if (Agent is not CarrierBase carrier || carrier.NumSubInterceptorsRemaining <= 0) {
 014      return new List<IAgent>();
 15    }
 16
 017    List<IHierarchical> leafHierarchicals =
 18        Agent.HierarchicalAgent.LeafHierarchicals(activeOnly: false, withTargetOnly: true);
 019    return Release(leafHierarchicals);
 020  }
 21
 22  // Release the sub-interceptors for the given leaf hierarchical objects.
 23  protected abstract List<IAgent> Release(IEnumerable<IHierarchical> hierarchicals);
 24}