diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-02-03 20:03:36 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-02-03 20:03:36 +0100 |
commit | 209c6412ae149cc7c503fd7da384f344a830423c (patch) | |
tree | 5baeaeb8dee2208b46bf80a118dfe59eb65f9389 /src/CBot/tests/TestCBot/a§1.txt~ | |
parent | 3f41f97fc47fca22634dc858c3ecdb39d0d27e32 (diff) | |
download | colobot-209c6412ae149cc7c503fd7da384f344a830423c.tar.gz colobot-209c6412ae149cc7c503fd7da384f344a830423c.tar.bz2 colobot-209c6412ae149cc7c503fd7da384f344a830423c.zip |
Refactoring in tests infrastructure
* all tests are now in /test/ subdirectory
* unit tests concatenated to one executable (TODO: ui, common)
* preparation for test environments (OpenGL and others)
* removed old TestCBot
Diffstat (limited to 'src/CBot/tests/TestCBot/a§1.txt~')
-rw-r--r-- | src/CBot/tests/TestCBot/a§1.txt~ | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/src/CBot/tests/TestCBot/a§1.txt~ b/src/CBot/tests/TestCBot/a§1.txt~ deleted file mode 100644 index 0c57950..0000000 --- a/src/CBot/tests/TestCBot/a§1.txt~ +++ /dev/null @@ -1,96 +0,0 @@ -object radarGuepe(point orig, float dist)
-{
- int i;
- object pr, r;
- float mindist;
-
- i = 0;
- mindist = 1000;
- while (i<30)
- {
- pr = radar(i);
- if (pr != null)
- {
-
- if (F(orig, pr.position) < mindist and pr.category == AlienWasp and pr.altitude > 3)
- {
- mindist = distance(orig, pr.position);
- r = pr;
- }
- }
- i = i+1;
- }
- if (mindist < dist) return(r); else return(null);
-}
-
-
-class Guepe
-{
-
- point pos;
-
-
- void cherche(point orig, float dist)
- {
- object p;
- point o;
-
- p = radarGuepe(orig, dist);
- while (p == null)
- {
- wait(0.1);
- p = radarGuepe(orig, dist);
- }
-
- pos.x = p.position.x;
- pos.y = p.position.y;
- pos.z = p.position.z;
-
- //o = p.position;
- //wait(0.1);
-
- //vitessex = (p.position.x - o.x)/0.1;
- //vitessey = (p.position.y - o.y)/0.1;
- //vitessez = (p.position.z - o.z)/0.1;
-
- }
-
-
- void tire(point orig, float orient)
- {
- //float t = 3; //temps d'anticipation
- float angle;
- point cible;
-
- cible.x = pos.x;// + t*vitessex;
- cible.y = pos.y;// + t*vitessey;
- cible.z = pos.z;// + t*vitessez;
-
- if (cible.x == 0) angle = 90; else
- angle = atan(cible.y / cible.x);
- if (cible.x < 0) angle = angle + 180;
- angle = angle - orient;
- if (angle > 180) angle = angle - 360;
- if (angle < -180) angle = angle + 360;
- turn(angle);
-
- angle = atan((cible.z-orig.z) / distance2d(orig, cible));
- aim(angle);
-
- fire(0.1);
-
- }
-}
-
-extern void object::Fourmi6()
-{
- //fps(1000);
- Guepe guepe = new Guepe();
-
- while (true)
- {
- guepe.cherche(position, 50);
-
- guepe.tire(position, orientation);
- }
-}
|