implement waves
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "ConfigLoader.h"
|
||||
#include "GameConfig.h"
|
||||
#include "Simulation.h"
|
||||
#include "Tick.h"
|
||||
#include "TickDriver.h"
|
||||
|
||||
static GameConfig loadConfig()
|
||||
{
|
||||
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Simulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
TEST_CASE("Simulation::currentTick starts at 0", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
const Simulation sim(config);
|
||||
|
||||
REQUIRE(sim.currentTick() == 0);
|
||||
@@ -19,7 +25,7 @@ TEST_CASE("Simulation::currentTick starts at 0", "[simulation]")
|
||||
|
||||
TEST_CASE("Simulation::tick increments currentTick by 1", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
Simulation sim(config);
|
||||
|
||||
sim.tick();
|
||||
@@ -29,7 +35,7 @@ TEST_CASE("Simulation::tick increments currentTick by 1", "[simulation]")
|
||||
|
||||
TEST_CASE("Simulation::tick 10 times yields currentTick == 10", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
Simulation sim(config);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
@@ -42,7 +48,7 @@ TEST_CASE("Simulation::tick 10 times yields currentTick == 10", "[simulation]")
|
||||
|
||||
TEST_CASE("Simulation::drainFireEvents returns empty initially", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
Simulation sim(config);
|
||||
|
||||
REQUIRE(sim.drainFireEvents().empty());
|
||||
@@ -50,7 +56,7 @@ TEST_CASE("Simulation::drainFireEvents returns empty initially", "[simulation]")
|
||||
|
||||
TEST_CASE("Simulation::drainFireEvents clears queue on drain", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
Simulation sim(config);
|
||||
|
||||
// First drain: empty.
|
||||
@@ -62,7 +68,7 @@ TEST_CASE("Simulation::drainFireEvents clears queue on drain", "[simulation]")
|
||||
|
||||
TEST_CASE("Simulation::drainBlueprintDropEvents returns empty initially", "[simulation]")
|
||||
{
|
||||
const GameConfig config;
|
||||
const GameConfig config = loadConfig();
|
||||
Simulation sim(config);
|
||||
|
||||
REQUIRE(sim.drainBlueprintDropEvents().empty());
|
||||
|
||||
Reference in New Issue
Block a user