Flint Particle System Forum - Initializing a particle's dictionary Mon, 09 May 2016 05:15:09 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Initializing a particle's dictionary http://flintparticles.org/forum/comments.php?DiscussionID=364&Focus=1227#Comment_1227 http://flintparticles.org/forum/comments.php?DiscussionID=364&Focus=1227#Comment_1227 Fri, 04 Jun 2010 00:42:29 +0100 Richard Clark
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 http://flintparticles.org/forum/comments.php?DiscussionID=364&Focus=1234#Comment_1234 Thu, 17 Jun 2010 10:36:12 +0100 Richard
Sounds like a good idea. I'll try to include it soon.

Richard ]]>