< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ReleaseStrategyBase(...)0%110100%
Release()0%3.213071.43%

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 {
 565  public IAgent Agent { get; init; }
 6
 287  public ReleaseStrategyBase(IAgent agent) {
 148    Agent = agent;
 149  }
 10
 11  // Release the sub-interceptors.
 1412  public List<IAgent> Release() {
 1413    if (Agent is not CarrierBase carrier || carrier.NumSubInterceptorsRemaining <= 0) {
 014      return new List<IAgent>();
 15    }
 16
 1417    List<IHierarchical> leafHierarchicals =
 18        Agent.HierarchicalAgent.LeafHierarchicals(activeOnly: false, withTargetOnly: true);
 1419    return Release(leafHierarchicals);
 1420  }
 21
 22  // Release the sub-interceptors for the given leaf hierarchical objects.
 23  protected abstract List<IAgent> Release(IEnumerable<IHierarchical> hierarchicals);
 24}