< Summary

Information
Class: Lattice.ECS.Framework.Systems.MovementSystem
Assembly: Lattice
File(s): /home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Framework/Systems/MovementSystem.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 29
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
OnInit(...)100%11100%
OnUpdate(...)100%22100%
OnDestroy(...)100%11100%

File(s)

/home/runner/work/Sideline/Sideline/godot/scripts/lattice/ECS/Framework/Systems/MovementSystem.cs

#LineLine coverage
 1using Lattice.ECS.Core;
 2using Lattice.Math;
 3
 4namespace Lattice.ECS.Framework.Systems
 5{
 6    /// <summary>
 7    /// 最小样例移动系统。
 8    /// </summary>
 9    public sealed class MovementSystem : ISystem
 10    {
 11        public void OnInit(Frame frame)
 12        {
 1013        }
 14
 15        public void OnUpdate(Frame frame, FP deltaTime)
 16        {
 12017            var enumerator = frame.Query<Position2D, Velocity2D>().GetEnumerator();
 66918            while (enumerator.MoveNext())
 19            {
 54920                enumerator.Component1.X += enumerator.Component2.X * deltaTime;
 54921                enumerator.Component1.Y += enumerator.Component2.Y * deltaTime;
 22            }
 12023        }
 24
 25        public void OnDestroy(Frame frame)
 26        {
 1027        }
 28    }
 29}