Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue #3 ; add methods declarations into robot.h

  • Loading branch information...
commit ff24c172effa862da7acf8cd5840440ba0460df1 1 parent 2da4231
@SmirnoffYM SmirnoffYM authored
View
24 constants.h
@@ -0,0 +1,24 @@
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
+
+/*
+ Define all specific constants, like
+ number of robots, number of environment objects, etc.:
+*/
+
+#define PERFORM_ACTION_FREQUENCY 30 //how many times robot performs his actions per second
+#define REAL_PIXEL_SIZE 60 //number of cells in real pixel
+#define ENV_OBJECTS 255 //number of environment objects
+#define CUSTOM_PARAMETERS_QUANTITY 16 //number of custom robot params
+
+enum Intersection { Allowed, Denied, AllowedForSameColor };
+
+/* Define some non-crossplatform math constants: */
+
+#define PI 3.14159265358979323846
+
+#endif // CONSTANTS_H
+
+/* Limit line length to 100 characters; highlight 99th column
+ * vim: set textwidth=100 colorcolumn=-1:
+ */
View
2  example/environment/Environment.pro
@@ -21,7 +21,7 @@ SOURCES += main.cpp \
HEADERS += \
manager.h \
envobject.h \
- constants.h \
+ ../../constants.h \
../../NetworkingManager.h \
../../messages.h \
../../messages-serializers.h
View
2  example/robot/Robot.pro
@@ -20,7 +20,7 @@ SOURCES += main.cpp \
HEADERS += \
robot.h \
- constants.h \
+ ../../constants.h \
manager.h \
../../NetworkingManager.h \
../../messages.h \
View
2  example/robot/manager.h
@@ -2,7 +2,7 @@
#define MANAGER_H
#include <QObject>
-#include "constants.h"
+#include "../../constants.h"
#include "robot.h"
class Manager : public QObject
View
2  example/robot/robot.cpp
@@ -64,7 +64,7 @@ void Robot::whoIsThere(unsigned int x, unsigned int y, unsigned int radius)
m.coordX = x;
m.coordY = y;
m.radius = radius;
- network->move(&m);
+ network->send(&m);
// TODO: update robot's internal state
View
7 example/robot/robot.h
@@ -5,7 +5,7 @@
#include <QUdpSocket>
#include <QVariant>
#include "../../NetworkingManager.h"
-#include "constants.h"
+#include "../../constants.h"
class Robot
{
@@ -24,6 +24,11 @@ class Robot
public:
void move(int x, int y);
+ void turn(double degrees);
+ void changeDiameter(unsigned int diameter);
+ void changeColor(char red, char green, char blue);
+ void whoIsThere(unsigned int x, unsigned int y, unsigned int radius);
+ void reportParameter(char id, int integral, unsigned int real);
public:
// getters
Please sign in to comment.
Something went wrong with that request. Please try again.