#include "stdafx.h"
#include "ExampleState.h"

ExampleState::ExampleState() {
  // Create an example object to display on screen
  std::unique_ptr<ExampleObject> player(new ExampleObject());
  object_manager_.Add(std::move(player));

  // SFML will play audio in a seperate thread so we dont have to worry about that
  // and just play the song 
  auto song = audio_cache_.GetSong("sounds/example.flac");
  if (song != nullptr) {
    song->setLoop(true);
    song->play();
  }
}

ExampleState::~ExampleState() {

}

void ExampleState::Draw(sf::RenderWindow& window, int32_t dt) {
  object_manager_.DrawAll(window, dt);
}

void ExampleState::Update(int32_t dt) {
  object_manager_.UpdateAll(dt);
}

void ExampleState::HandleInput() {

}
#include "stdafx.h"
#include "ExampleState.h"

ExampleState::ExampleState() {
  // Create an example object to display on screen
  std::unique_ptr<ExampleObject> player(new ExampleObject());
  object_manager_.Add(std::move(player));

  // SFML will play audio in a seperate thread so we dont have to worry about that
  // and just play the song 
  auto song = audio_cache_.GetMusic("sounds/example.flac");
  if (song != nullptr) {
    song->setLoop(true);
    song->play();
  }
}

ExampleState::~ExampleState() {

}

void ExampleState::Draw(sf::RenderWindow& window, int32_t dt) {
  object_manager_.DrawAll(window, dt);
}

void ExampleState::Update(int32_t dt) {
  object_manager_.UpdateAll(dt);
}

void ExampleState::HandleInput() {

}
Update use of audio cache function after rename
Update use of audio cache function after rename
