Skip to content

CountMap

Overview

Data structure that handles creating/destroying related objects that need to exist when something's count is >=1

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class CountMap

import { CountMap } from 'scenerystack/scenery';

Constructor

new CountMap( create, destroy )

Instance Methods

increment( key, quantity )

@public

@param {*} key @param {number} [quantity]

decrement( key, quantity )

@public

@param {*} key @param {number} [quantity]

get( key )

@public

@param {} key @returns {}

clear()

@public

NOTE: We COULD try to collect all of the CountMapEntries... but that seems like an awful lot of CPU. If GC is an issue from this, we can add more logic

Source Code

See the source for CountMap.js in the scenery repository.