Esempio n. 1
0
        public Emitter(int capacity, TimeSpan term, Profile profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }

            _term = (float)term.TotalSeconds;

            Buffer = new ParticleBuffer(capacity);
            Offset = new Vector();

            switch (profile.Name)
            {
            case nameof(Profile.EnumEmitterProfiles.BoxFillProfile):
                Profile = Profile.BoxFill(profile.Width, profile.Height);
                break;

            case nameof(Profile.EnumEmitterProfiles.BoxProfile):
                Profile = Profile.Box(profile.Width, profile.Height);
                break;

            case nameof(Profile.EnumEmitterProfiles.BoxUniformProfile):
                Profile = Profile.BoxUniform(profile.Width, profile.Height);
                break;

            case nameof(Profile.EnumEmitterProfiles.CircleProfile):
                Profile = Profile.Circle(profile.Radius, profile.Radiate);
                break;

            case nameof(Profile.EnumEmitterProfiles.LineProfile):
                Profile = Profile.Line(profile.Axis, profile.Length);
                break;

            case nameof(Profile.EnumEmitterProfiles.PointProfile):
                Profile = Profile.Point();
                break;

            case nameof(Profile.EnumEmitterProfiles.RingProfile):
                Profile = Profile.Ring(profile.Radius, profile.Radiate);
                break;

            case nameof(Profile.EnumEmitterProfiles.SprayProfile):
                Profile = Profile.Spray(profile.Direction, profile.Spread);
                break;
            }

            if (Profile == null)
            {
                Profile = profile;
            }

            Modifiers = new Dictionary <string, IModifier>();
            ModifierExecutionStrategy = ModifierExecutionStrategy.Serial();

            Parameters = new ReleaseParameters();
        }
Esempio n. 2
0
 public ParticleIterator(ParticleBuffer buffer)
 {
     _buffer = buffer;
 }