summaryrefslogtreecommitdiff
path: root/src/datatypes.ads
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2022-11-18 02:40:52 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2022-11-18 02:40:52 +1300
commite7892f0f87a9258d3b45e9d0cf674ce142f761eb (patch)
tree2948e299f1c230bbbf1438d50d186441ba41dc34 /src/datatypes.ads
parente60b21609c013661638191b1251d6ae31c389cf9 (diff)
Refactored code into appropriate packages
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;
+