Closed hbina closed 5 years ago
It currently does not even compile, I have no idea how to proceed past this wall of error messages.
error[E0599]: no method named `join` found for type `(&specs::storage::Storage<'_, components::combat::Damage, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::combat::Damage>>>, specs::storage::AntiStorage<'_>, &specs::storage::Storage<'_, components::combat::Speed, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::combat::Speed>>>, &mut specs::storage::Storage<'_, components::digestion::Nutrition, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::digestion::Nutrition>>>, &hibitset::BitSet)` in the current scope
--> src/systems/combat.rs:83:119
|
83 | for (damage, _, speed, mut fullness, _) in (&damages, !&cooldowns, &speeds, &mut fullnesses, &attack_set).join() {
| ^^^^
|
= note: the method `join` exists but the following trait bounds were not satisfied:
`(&specs::storage::Storage<'_, components::combat::Damage, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::combat::Damage>>>, specs::storage::AntiStorage<'_>, &specs::storage::Storage<'_, components::combat::Speed, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::combat::Speed>>>, &mut specs::storage::Storage<'_, components::digestion::Nutrition, shred::res::Fetch<'_, specs::storage::MaskedStorage<components::digestion::Nutrition>>>, &hibitset::BitSet) : specs::join::Join`
afaik, I need to implement some trait but I don't know what.
Edit: Okay I fixed the issue now. Not sure if the implementation is correct tho.
If you're able to post a gameplay video with your changes applied then I might be able to tell you if you're on the right track.
Anyhow, great that you've started playing with this feature 👏
@erlend-sh
currently, for some reason, the grass won't be consumed...
https://www.youtube.com/watch?v=EW3lU-dHZiY&feature=youtu.be
I think this have to do with the added constraint in the ( ... ).join() I have added in combat.rs causing grasses to be excluded? I am not sure if herbivores are considered as "attackers" of grasses tho.
I think that eventually, we'll have to split attacks and feeding actions into their own distinct systems.
@sunreef yep, i did exactly that in my latest commit. do you want me to squash these commits?
https://www.youtube.com/watch?v=DlOHmINbQZA&feature=youtu.be
@hbina I didn't look at the code before commenting. Sorry 😅 We can wait for @marot or @khskarl to give their opinion before we merge.
Attempts to solve #51