#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2009 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
namespace Nuclex.Graphics.SpecialEffects.Particles {
/// Used to access particles in a generic manner
/// Data type of the particles
///
/// This interface allows generic particle affectors to modify custom particles
/// without knowing about their specific implementation details. This way,
/// generic particle affectors can be written that allow gravity, wind and
/// other effects to be reused on different particle types.
///
public interface IParticleAccessor {
/// Obtains the position of an individual particle
/// Particle whose position will be returned
///
/// Output parameter that will receive the particle's position
///
void GetPosition(ref ParticleType particle, out Vector3 position);
/// Changes the position of an individual particle
/// Particle whose position will be changed
/// Position the particle will be moved to
void SetPosition(ref ParticleType particle, ref Vector3 position);
/// Whether the particle type has a velocity
bool HasVelocity { get; }
/// Obtains the velocity of an individual particle
/// Particle whose velocity will be returned
///
/// Output parameter that will receive the particle's velocity
///
///
/// If the particle doesn't have a velocity, it's safe to set the velocity
/// to Vector3.Zero.
///
void GetVelocity(ref ParticleType particle, out Vector3 velocity);
/// Changes the velocity of an individual particle
/// Particle whose velocity will be changed
/// Velocity that will be assigned to the particle
///
/// If particles don't have a velocity, it's safe to do nothing in this method.
///
void SetVelocity(ref ParticleType particle, ref Vector3 velocity);
/// Whether the particle type has a weight
bool HasWeight { get; }
/// Obtains the weight of a particle
/// Particle whose weight will be returned
/// The weight of the provided particle
float GetWeight(ref ParticleType particle);
/// Changes the weight of a particle
/// Particle whose weight will be set
/// Weight that will be assigned to the particle
void SetWeight(ref ParticleType particle, float weight);
}
} // namespace Nuclex.Graphics.SpecialEffects.Particles