summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Particles/Profiles/Profile.cs
blob: bfde371bae29ef356fb0e12caa998f50996e714a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using Microsoft.Xna.Framework;

namespace MonoGame.Extended.Particles.Profiles
{
    public abstract class Profile
    {
        public enum CircleRadiation
        {
            None,
            In,
            Out
        }

        protected FastRandom Random { get; } = new FastRandom();

        public abstract void GetOffsetAndHeading(out Vector2 offset, out Vector2 heading);

        public object Clone()
        {
            return MemberwiseClone();
        }

        public static Profile Point()
        {
            return new PointProfile();
        }

        public static Profile Line(Vector2 axis, float length)
        {
            return new LineProfile {Axis = axis, Length = length};
        }

        public static Profile Ring(float radius, CircleRadiation radiate)
        {
            return new RingProfile {Radius = radius, Radiate = radiate};
        }

        public static Profile Box(float width, float height)
        {
            return new BoxProfile {Width = width, Height = height};
        }

        public static Profile BoxFill(float width, float height)
        {
            return new BoxFillProfile {Width = width, Height = height};
        }

        public static Profile BoxUniform(float width, float height)
        {
            return new BoxUniformProfile {Width = width, Height = height};
        }

        public static Profile Circle(float radius, CircleRadiation radiate)
        {
            return new CircleProfile {Radius = radius, Radiate = radiate};
        }

        public static Profile Spray(Vector2 direction, float spread)
        {
            return new SprayProfile {Direction = direction, Spread = spread};
        }

        public override string ToString()
        {
            return GetType().ToString();
        }
    }
}