Flint Particle System Forum - Initializing a particle's dictionary 2016-05-08T22:01:07+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Initializing a particle's dictionary http://flintparticles.org/forum/comments.php?DiscussionID=364&Focus=1227#Comment_1227 2010-06-04T00:42:29+01:00 2016-05-08T22:01:07+01:00 Richard Clark http://flintparticles.org/forum/account.php?u=246 I'm writing biomedical simulations using Flint (see an example at http://elearning.millipore.com) and I'm using the dictionary property to add additional data to each particle. I've found it useful ...
May I propose this become part of a future release?

...Richard

--- cut here ---

package org.flintparticles.common.initializers
{
import flash.utils.Dictionary;

import org.flintparticles.common.emitters.Emitter;
import org.flintparticles.common.particles.Particle;

public class DictionaryInitializer extends InitializerBase
{
private var _template: Object;

public function DictionaryInitializer(template:Object)
{
_template = template;
}

public override function initialize(emitter:Emitter, particle:Particle):void
{
if (_template == null) return;
var dict: Dictionary = particle.dictionary;
for (var key:* in _template) {
dict[key] = _template[key];
}
}

}
}]]>
Initializing a particle's dictionary http://flintparticles.org/forum/comments.php?DiscussionID=364&Focus=1234#Comment_1234 2010-06-17T10:36:12+01:00 2016-05-08T22:01:07+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Hi Richard Sounds like a good idea. I'll try to include it soon. Richard
Sounds like a good idea. I'll try to include it soon.

Richard]]>