container

package
v0.0.0-...-e6fda21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2025 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package container implements different containers that may be needed for implementation of data oriented game design.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Zero

func Zero[T any]() T

Types

type Resource

type Resource[T any] struct {
	// contains filtered or unexported fields
}

func (*Resource[T]) Get

func (r *Resource[T]) Get() (T, bool)

func (*Resource[T]) Set

func (r *Resource[T]) Set(val T)

type Set

type Set map[gid.ID]struct{}

func (*Set) Add

func (s *Set) Add(id gid.ID)

func (*Set) Delete

func (s *Set) Delete(id gid.ID)

func (*Set) Get

func (s *Set) Get(id gid.ID) bool

type SparseArray

type SparseArray[T any] struct {
	// contains filtered or unexported fields
}

func (*SparseArray[T]) Delete

func (sa *SparseArray[T]) Delete(id gid.ID)

func (*SparseArray[T]) Get

func (sa *SparseArray[T]) Get(id gid.ID) (T, bool)

func (*SparseArray[T]) Items

func (sa *SparseArray[T]) Items() iter.Seq2[gid.ID, T]

func (*SparseArray[T]) Set

func (sa *SparseArray[T]) Set(id gid.ID, val T)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL