summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/ia/ia.cc
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/ia/ia.cc')
-rw-r--r--2003/i/buzz/src/ia/ia.cc72
1 files changed, 72 insertions, 0 deletions
diff --git a/2003/i/buzz/src/ia/ia.cc b/2003/i/buzz/src/ia/ia.cc
new file mode 100644
index 0000000..14f47a2
--- /dev/null
+++ b/2003/i/buzz/src/ia/ia.cc
@@ -0,0 +1,72 @@
+// ia.cc
+// buzz - Programme du robot Efrei Robotique I1-I2 2003
+// Copyright (C) 2003 Nicolas Schodet
+//
+#include "ia.h"
+
+// Instance unique.
+Ia *Ia::m_instance = 0;
+
+// Constructeur.
+Ia (const char *strat)
+{
+ // Instancie les objets du robot.
+ m_thresholds = new Thresholds ("rc/vision/palets.rgb");
+ m_camera = new Camera ();
+ m_image = new Image (c, t);
+ m_grafcet = new Grafcet (strat);
+ // Init.
+ m_instance = this;
+ m_paletFound = false;
+ for (int i = 0; i < 8; ++i)
+ {
+ m_var[i] = 0;
+ m_tempo[i] = 0;
+ }
+}
+
+// Destructeur.
+~Ia (void)
+{
+ m_instance = 0;
+ delete m_grafcet;
+ delete m_image;
+ delete m_camera;
+ delete m_thresholds;
+}
+
+// Cherche un palet.
+bool
+Ia::seekPalet (void)
+{
+ i->reread ();
+}
+
+// Va vers le palet précédement trouvé.
+void
+Ia::goPalet (void)
+{
+}
+
+// Variable de l'ia.
+int getVar (int var)
+{
+ return m_var[var];
+}
+
+void setVar (int var, int val)
+{
+ m_var[var] = val;
+}
+
+// Tempos de l'ia.
+void resetTempo (int tempo)
+{
+ m_tempo[tempo] = m_date.start ();
+}
+
+int getTempo (int tempo)
+{
+ return m_date.start () - m_tempo[tempo];
+}
+