summaryrefslogtreecommitdiff
path: root/src/datatypes.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/datatypes.ads')
-rw-r--r--src/datatypes.ads33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/datatypes.ads b/src/datatypes.ads
new file mode 100644
index 0000000..50d21f9
--- /dev/null
+++ b/src/datatypes.ads
@@ -0,0 +1,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;
+