< Summary

Class:AttackBehaviorBase
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Behavior/AttackBehaviorBase.cs
Covered lines:13
Uncovered lines:0
Coverable lines:13
Total lines:37
Line coverage:100% (13 of 13)
Covered branches:0
Total branches:0
Covered methods:6
Total methods:6
Method coverage:100% (6 of 6)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AttackBehaviorBase(...)0%110100%

File(s)

/github/workspace/Assets/Scripts/Behavior/AttackBehaviorBase.cs

#LineLine coverage
 1using UnityEngine;
 2
 3// Base implementation of an attack behavior.
 4public abstract class AttackBehaviorBase : IAttackBehavior {
 5  // Attack behavior configuration.
 6  private Configs.AttackBehaviorConfig _config;
 7
 8  // Flight plan.
 9  private FlightPlan _flightPlan;
 10
 11  // Agent that will execute the attack behavior.
 1212  public IAgent Agent { get; init; }
 13
 14  public Configs.AttackBehaviorConfig Config {
 615    get => _config;
 616    init => _config = value;
 17  }
 18
 19  public FlightPlan FlightPlan {
 4820    get {
 5421      if (_flightPlan == null) {
 622        _flightPlan = new FlightPlan(Config?.FlightPlan);
 623      }
 4824      return _flightPlan;
 4825    }
 26  }
 27
 1228  public AttackBehaviorBase(IAgent agent, Configs.AttackBehaviorConfig config) {
 629    Agent = agent;
 630    Config = config;
 631  }
 32
 33  // Return the next waypoint for the agent to navigate to and the power setting to use towards the
 34  // waypoint.
 35  public abstract (Vector3 waypointPosition, Configs.Power power)
 36      GetNextWaypoint(in Vector3 targetPosition);
 37}