Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] : E0304 to be fix ASAP #14

Open
Mideky-hub opened this issue Nov 21, 2024 · 1 comment
Open

[BUG] : E0304 to be fix ASAP #14

Mideky-hub opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed logic Affect the behavior of the game, likely unrelated to the GUI

Comments

@Mideky-hub
Copy link
Member

Gravité Code Description Projet Fichier Ligne État de la suppression Détails
Erreur (active) E0304 aucune instance de modèle de fonction "resource_manager::get_resource" ne correspond à la liste d'arguments clicker C:\Users\Spectrum\Documents\PROG\clicker\clicker\game.hpp 93

inline const bool can_be_resources_purshased(const e_technology_type& type_) noexcept {
	const auto& resource_costs = this->m_techtree.m_technologies.at(type_).get()->m_resources_cost;
	for (const auto& [resource_type, cost] : resource_costs) {
		if (this->m_resources.get_resource<resource_type>().get_amount() < cost) {
			return false;
		}
	}
	return true;
}

Here the get_resources doesn't accept the untemplatized implementation of can_be_purshased and therefore throws an E0304 which may be avoidable with a abstraction layer, but idk seems fucked.

@Mideky-hub Mideky-hub added bug Something isn't working help wanted Extra attention is needed logic Affect the behavior of the game, likely unrelated to the GUI labels Nov 21, 2024
@Mideky-hub
Copy link
Member Author

First sight in the problem and we'll go through runtime abstraction here, with the cuirrent mapping in the unorderedmap we can access the i_resource that point at the get_amount type.

Current state, wait for unit test.

Mideky-hub added a commit that referenced this issue Nov 21, 2024
…ction by mapping to RT-resources for runtime bypass the template (TBT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed logic Affect the behavior of the game, likely unrelated to the GUI
Projects
None yet
Development

No branches or pull requests

1 participant