summaryrefslogtreecommitdiff
path: root/src/datatypes.ads
blob: 50d21f9d7abec6227b463678022c7768f6389f88 (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

with

    Ada.Numerics.Generic_Complex_Types,
    Ada.Containers.Vectors;

package Datatypes is

    type Quantity is digits 18;

    package Plane is new Ada.Numerics.Generic_Complex_Types (Real => Quantity);

    type Particle is record
        Place        : Plane.Complex;
        Solid        : Boolean;
        Density      : Quantity := 0.0;
        Acceleration : Plane.Complex := Plane.Compose_From_Cartesian (0.0, 0.0);
        Velocity     : Plane.Complex := Plane.Compose_From_Cartesian (0.0, 0.0);
    end record;

    function Create
           (X, Y  : in Quantity;
            Solid : in Boolean)
        return Particle;

    package Particle_Vectors is new Ada.Containers.Vectors
       (Index_Type   => Positive,
        Element_Type => Particle);

    subtype Particle_Vector is Particle_Vectors.Vector;

end Datatypes;