hexga_generational 0.0.11-beta.50

GenVec, ideal for MAS (Multi-Agent System), where each agent can be removed at any time and has references to other agents.
Documentation
use hexga_core::prelude::*;
use hexga_generational::{gen_seq::GenArrayVec, prelude::*};

#[derive(Debug)]
pub struct Entity
{
    hp: i32,
}

fn increase_hp<'a>(entities: GenViewMut<'a, Entity>)
{
    for (_id, entity) in entities
    {
        entity.hp += 1;
    }
}

fn main()
{
    let mut entities = GenArrayVec::<Entity, 4>::new();
    entities.push(Entity { hp: 42 });
    entities.push(Entity { hp: 99 });
    entities.push(Entity { hp: 99 });
    entities.push(Entity { hp: 99 });
    entities.push(Entity { hp: 99 });
    entities.push(Entity { hp: 99 });
    println!("{:?}", entities);

    increase_hp(entities.as_mut());
    println!("{:?}", entities);
}