cougr-core 1.0.0

Cougr - A Soroban-compatible ECS framework for on-chain gaming on Stellar
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::simple_world::EntityId as SimpleEntityId;
use soroban_sdk::Vec;

pub(super) fn contains_entity(entities: &Vec<SimpleEntityId>, entity_id: SimpleEntityId) -> bool {
    for i in 0..entities.len() {
        if let Some(candidate) = entities.get(i) {
            if candidate == entity_id {
                return true;
            }
        }
    }
    false
}