
.include "cmp/array_structure.h.s"
.include "man/entity.h.s"
.include "cpctelera.h.s"


DefineComponentPointersArrayStructure_Size _collision, max_entities


man_entity_collision_init::

	ld hl, #_collision_ptr_array
	ld (_collision_ptr_pend), hl


	xor a
	ld (hl), a
	ld d, h
	ld e, l
	inc de
	ld bc, #2*max_entities-1

	ldir


man_entity_collision_getArrayHL::
	ld hl, #_collision_ptr_array
	ret


man_entity_collision_add::

	ld hl, (_collision_ptr_pend)
	ld__a_ixl
	ld (hl), a
	inc hl
	ld__a_ixh
	ld (hl), a

	inc hl
	ld (_collision_ptr_pend), hl

	ret

man_entity_collision_sub::

	ld hl, (_collision_ptr_pend)
	ld__a_ixl
	ld (hl), a
	dec hl
	ld__a_ixh
	ld (hl), a

	dec hl
	ld (_collision_ptr_pend), hl

	ret