EtrediaEmpires/ECSAPI/ECS/test/test_conf.hpp
legatt ff6c146153 Enterprise salary and API
- Enterprises have action type, money, salary and bankruption status
- Enterprise add and multiply functions replaced with setters
- Delivery contracts have cost, distance and sponsor reference. Value renamed to amount
- Integer values use static sizes types
- Action CONTAIN renamed to STORE
- Enterprises skip their action if is bankrupt
- Delivering transfers money from sponsor to deliverer due contract
- Enterprise routine system processes salaries and bankruptcy
- ee_ecs data structures renamed with snake_case
- Get enterprises info request
2025-08-06 17:52:37 +03:00

36 lines
1.1 KiB
C++

#pragma once
#include <gtest/gtest.h>
#include <ee_ecs/ecs.hpp>
struct WorldBenchmark : testing::Test
{
ee_ecs::world world;
void SetUp()
{
for (int16_t i = 0; i < 1000; i++)
{
ee_economy::container resources = {.capacity = 100.0};
resources.add(ee_economy::RESOURCE_TYPE::COAL, 100.0);
entt::entity state = world.register_state(i, resources);
ee_economy::enterprise_defaults miner = {
.container = {.capacity = 100.0},
.resource_target = ee_economy::RESOURCE_TYPE::GOLD,
.base_efficiency = 1.0
};
world.spawn_enterprise(false, ee_economy::ACTION_TYPE::MINING, state, miner);
world.spawn_enterprise(false, ee_economy::ACTION_TYPE::MINING, state, miner);
world.spawn_enterprise(false, ee_economy::ACTION_TYPE::MINING, state, miner);
world.spawn_enterprise(false, ee_economy::ACTION_TYPE::MINING, state, miner);
world.spawn_enterprise(false, ee_economy::ACTION_TYPE::MINING, state, miner);
}
}
void TearDown()
{
}
};