LCOV - code coverage report
Current view: top level - src - physicssystem.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 10 30.0 %
Date: 2020-10-15 20:26:03 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "physicssystem.h"
       2             : 
       3             : #include "game.h"
       4             : 
       5           5 : void PhysicsSystem::update() {
       6           5 :     for (auto& ph : game_.physics.values()) {
       7           0 :         if (ph.type == PhysicsType::Projectile) {
       8           0 :             ph.position += ph.velocity;
       9           0 :             ph.velocity *= 0.95;
      10             :             // TODO: detect collisions
      11             :         }
      12             : 
      13             :         // Update position of sprite
      14           0 :         auto& e = game_.entities[ph.entity];
      15           0 :         if (e.sprite) {
      16           0 :             auto& sprite = game_.sprites[e.sprite];
      17           0 :             sprite.position = (vec2i)ph.position;
      18             :         }
      19             :     }
      20           5 : }

Generated by: LCOV version 1.13