<commit_before>package org.bvoid.engine.core;

import java.util.List;
import java.util.function.Supplier;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import org.bvoid.engine.core.configuration.Initializer;
import org.bvoid.engine.input.InputService;
import org.bvoid.engine.scene.camera.CameraUpdateService;
import org.bvoid.engine.view.View;
import org.bvoid.engine.window.GlfwWindowCloser;

@Named
public class Engine {


  @Inject
  private Supplier<List<Initializer>> initializerSupplier;

  // TODO discuss closer approach
  @Inject
  private GlfwWindowCloser windowCloser;

  // TODO discuss update approach
  @Inject
  private CameraUpdateService cameraUpdateService;
  @Inject
  private InputService inputService;
  @Inject
  private View view;

  /**
   * Run the engine.
   */
  @PostConstruct
  public void run() {
    try {
      init();
      loop();
    } finally {
      close();
    }
  }

  private void init() {
    initializerSupplier.get().forEach(Initializer::init);
  }

  private void loop() {
    while (!view.shouldClose()) {
      // (1) Input
      inputService.update();
      // (2) GameLogic
      // (3) Camera
      cameraUpdateService.update();
      // (4) World <-> Physics (The physics cycle may happen more than once per frame if the fixed
      // time step is less than the actual frame update time.)
      // (5) GUI (OnGUI is called multiple time per frame update.)
      // (6) AI
      // (7) Audio
      // (8) Render
      view.update();
      // (X) Possible Pause
    }
  }

  private void close() {
    windowCloser.close();
  }

}
<commit_msg>Camera removed<commit_after>package org.bvoid.engine.core;

import java.util.List;
import java.util.function.Supplier;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import org.bvoid.engine.core.configuration.Initializer;
import org.bvoid.engine.input.InputService;
import org.bvoid.engine.view.View;
import org.bvoid.engine.window.GlfwWindowCloser;

@Named
public class Engine {


  @Inject
  private Supplier<List<Initializer>> initializerSupplier;

  // TODO discuss closer approach
  @Inject
  private GlfwWindowCloser windowCloser;

  // TODO discuss update approach
  @Inject
  private InputService inputService;
  @Inject
  private View view;

  /**
   * Run the engine.
   */
  @PostConstruct
  public void run() {
    try {
      init();
      loop();
    } finally {
      close();
    }
  }

  private void init() {
    initializerSupplier.get().forEach(Initializer::init);
  }

  private void loop() {
    while (!view.shouldClose()) {
      // (1) Input
      inputService.update();
      // (2) GameLogic
      // (3) World <-> Physics (The physics cycle may happen more than once per frame if the fixed
      // time step is less than the actual frame update time.)
      // (4) GUI (OnGUI is called multiple time per frame update.)
      // (5) AI
      // (6) Audio
      // (7) Render
      view.update();
      // (X) Possible Pause
    }
  }

  private void close() {
    windowCloser.close();
  }

}

{'fraction_non_alphanumeric': 0.11560693641618497, 'fraction_numerical': 0.004816955684007707, 'mean_word_length': 2.8080684596577017, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5215068', 'n_tokens_mistral': 958, 'n_tokens_neox': 948, 'n_words': 258}