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

34 lines
716 B
C++

#pragma once
#include "ee_economy/components/container.hpp"
#include <entt/entity/fwd.hpp>
#include <entt/entt.hpp>
#include <ee_economy/economy.hpp>
#include <unordered_map>
namespace ee_ecs
{
class world
{
private:
entt::registry registry;
std::unordered_map<int16_t, entt::entity> states_table;
void update_enterprises();
public:
// Run every registered system
void update();
entt::entity register_state(const int16_t id, const ee_economy::container &resources);
entt::entity spawn_enterprise(
const bool is_building,
const ee_economy::ACTION_TYPE action,
const entt::entity state,
const ee_economy::enterprise_defaults &defaults
);
entt::registry& get_registry();
};
}