Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * "Debreceni Hivatásos FC++"
- *
- * lobogofcpp.h
- *
- * This agent, called "Debreceni Lobogó FC++", is a simple threaded version of
- * rcssserver/client.cpp It is used in our Programming laboratory exercises
- * at the University of Debrecen. For details, see the books "Bátfai
- * Norbert: Programozó Páternoszter újratöltve: C, C++, Java, Python és
- * AspectJ esettanulmányok"
- * http://www.inf.unideb.hu/~nbatfai/konyvek/PROP/prop.book.xml.pdf
- * and "Bátfai Norbert: Mesterséges intelligencia a gyakorlatban: bevezetés
- * a robotfoci programozásba"
- * http://www.inf.unideb.hu/~nbatfai/konyvek/MIRC/mirc.book.xml.pdf
- *
- * Norbert Bátfai, PhD
- * batfai.norbert@inf.unideb.hu, nbatfai@gmail.com
- * IT Dept, University of Debrecen
- *
- * Version history, see book PARP and POPR http://www.inf.unideb.hu/~nbatfai/konyvek/PROP/prop.book.xml.pdf
- *
- * May.04.2012, "A Bolyongó FC++", bolyongofcpp.h
- * May.11.2012, "Debreceni Lobogó FC++": this version knows the flags.
- * May.12.2012, "Debreceni Egyetértés FC++"
- * May.13.2012, "Debreceni Hivatásos FC++"
- * Aug.13.2012, "Debrecen Great Forest FC++"
- * Aug.18.2012, "Debrecen Deep Forest FC++"
- * Aug.23.2012, "Debrecen Round Forest FC++"
- *
- */
- /*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * http://www.gnu.org/licenses/gpl.html
- */
- /*
- * References
- * Felhasznált és ajánlott irodalom:
- *
- * Don Blaheta: Project 2: Lexer
- * http://torvalds.cs.longwood.edu/courses/cmsc445/s12/proj2.pdf
- *
- * John R. Levine: flex & bison, O’Reilly, 2009
- *
- * Lexical Analysis With Flex
- * http://flex.sourceforge.net/manual
- *
- * Bison - GNU parser generator
- * www.gnu.org/software/bison/manual/
- * A Complete C++ Example
- * http://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html#A-Complete-C_002b_002b-Example
- * http://www.gnu.org/software/bison/manual/html_node/C_002b_002b-Parsers.html#C_002b_002b-Parsers
- */
- #ifndef LOBOGOFCPP_H
- #define LOBOGOFCPP_H
- #ifndef __FLEX_LEXER_H
- #include <FlexLexer.h>
- #endif
- #include <iostream>
- #include <sstream>
- #include <cstring>
- #include <cmath>
- enum RefereePlayMode {
- before_kick_off,
- play_on,
- half_time,
- drop_ball,
- kick_off_r,
- kick_off_l,
- corner_kick_r,
- corner_kick_l,
- free_kick_l,
- free_kick_r,
- kick_in_l,
- kick_in_r,
- goal_l,
- goal_r,
- free_kick_fault_l,
- free_kick_fault_r,
- offside_l,
- offside_r
- };
- class Formations
- {
- public:
- static int const F_4_3_3_H = 0;
- static int const F_4_3_3_F = 1;
- static int const F_4_4_2_H = 2;
- static int const F_4_4_2_F = 3;
- static int const Chelsea_H = 4;
- static int const Chelsea_F = 5;
- static int const Penta1 = 6;
- static int const Penta2 = 7;
- static int const F_CORNER_ATT = 8;
- static int const F_CORNER_DEF = 9;
- // number of all formations
- static int const NOF = F_CORNER_DEF+1;
- };
- class Formation
- {
- public:
- Formation(int p0x, int p0y,
- int p1x, int p1y,
- int p2x, int p2y,
- int p3x, int p3y,
- int p4x, int p4y,
- int p5x, int p5y,
- int p6x, int p6y,
- int p7x, int p7y,
- int p8x, int p8y,
- int p9x, int p9y,
- int p10x, int p10y)
- {
- formation[0][0] = p0x;
- formation[0][1] = p0y;
- formation[1][0] = p1x;
- formation[1][1] = p1y;
- formation[2][0] = p2x;
- formation[2][1] = p2y;
- formation[3][0] = p3x;
- formation[3][1] = p3y;
- formation[4][0] = p4x;
- formation[4][1] = p4y;
- formation[5][0] = p5x;
- formation[5][1] = p5y;
- formation[6][0] = p6x;
- formation[6][1] = p6y;
- formation[7][0] = p7x;
- formation[7][1] = p7y;
- formation[8][0] = p8x;
- formation[8][1] = p8y;
- formation[9][0] = p9x;
- formation[9][1] = p9y;
- formation[10][0] = p10x;
- formation[10][1] = p10y;
- };
- friend std::ostream & operator<< (std::ostream & os, Formation & f)
- {
- for (int i=0; i<11; ++i)
- os << "(" << f.formation[i][0] << ", " << f.formation[i][1] << ")" << std::endl;
- return os;
- }
- int get_formation_x(int squad_number, char lr) const
- {
- return (lr=='l') ? formation[squad_number][0] : -formation[squad_number][0];
- }
- int get_formation_y(int squad_number) const
- {
- return formation[squad_number][1];
- }
- private:
- int formation[11][2];
- };
- class Flag
- {
- public:
- // See the figure entitled "Figure 4.2: The fags and lines in the simulation."
- // in the RCSS manual, version "February 11, 2003" pp. 47. at http://sourceforge.net/projects/sserver/files/rcssmanual/9-20030211/
- static int const FCB = 0;
- static int const FC = 1;
- static int const FCT = 2;
- static int const GRB = 3;
- static int const GR = 4;
- static int const GRT = 5;
- static int const GLB = 6;
- static int const GL = 7;
- static int const GLT = 8;
- static int const PRB = 9;
- static int const PR = 10;
- static int const PRT = 11;
- static int const PLB = 12;
- static int const PL = 13;
- static int const PLT = 14;
- static int const RB = 15;
- static int const RT = 16;
- static int const LB = 17;
- static int const LT = 18;
- static int const FRB30 = 19;
- static int const FRB20 = 20;
- static int const FRB10 = 21;
- static int const FR0 = 22;
- static int const FRT10 = 23;
- static int const FRT20 = 24;
- static int const FRT30 = 25;
- static int const FLB30 = 26;
- static int const FLB20 = 27;
- static int const FLB10 = 28;
- static int const FL0 = 29;
- static int const FLT10 = 30;
- static int const FLT20 = 31;
- static int const FLT30 = 32;
- static int const FTR50 = 33;
- static int const FTR40 = 34;
- static int const FTR30 = 35;
- static int const FTR20 = 36;
- static int const FTR10 = 37;
- static int const FT0 = 38;
- static int const FTL10 = 39;
- static int const FTL20 = 40;
- static int const FTL30 = 41;
- static int const FTL40 = 42;
- static int const FTL50 = 43;
- static int const FBR50 = 44;
- static int const FBR40 = 45;
- static int const FBR30 = 46;
- static int const FBR20 = 47;
- static int const FBR10 = 48;
- static int const FB0 = 49;
- static int const FBL10 = 50;
- static int const FBL20 = 51;
- static int const FBL30 = 52;
- static int const FBL40 = 53;
- static int const FBL50 = 54;
- // number of all flags
- static int const NOF = FBL50+1;
- };
- class SeenFlag
- {
- public:
- SeenFlag(float x, float y):
- x(x),
- y(y),
- time_stamp(-1000) // a long time ago
- {};
- friend std::ostream & operator<< (std::ostream & os, SeenFlag & sf)
- {
- os << "x: " << sf.x << std::endl;
- os << "y: " << sf.y << std::endl;
- os << "time_stamp: " << sf.time_stamp << std::endl;
- return os;
- }
- int get_time_stamp() const
- {
- return time_stamp;
- }
- void set_time_stamp(int time_stamp)
- {
- this->time_stamp = time_stamp;
- }
- void setDist(int time_stamp, float dist) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- }
- void setAng(int time_stamp, float ang) {
- this->time_stamp = time_stamp;
- this->ang = ang;
- }
- void setDistAng(int time_stamp, float dist, float ang) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- this->ang= ang;
- }
- void setDistAngForSelfAng(int time_stamp, int ex, int ey, float estn, float & esta, float dist, float ang) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- this->ang= ang;
- if (dist > 0.0 && dist < 30.0) {
- /* még áganként kettébontani, hogy tg vagy ctg attól függően, hogy az irány alatt vagy felett van-e a zászló */
- if (x <= ex && y <= ey) {
- esta = 90 + (std::atan((x-ex)/(y-ey))* (180.0 / 3.14159265359) - ang - estn);
- //std::cout << "A**********" << " esta = " << esta << " ang = " << ang << " dist = " << dist << std::endl;
- } else if (x >= ex && y >= ey) {
- esta = std::atan((y-ey)/(x-ex))* (180.0 / 3.14159265359) - ang - estn;
- //std::cout << "B**********" << " esta = " << esta << " ang = " << ang << " dist = " << dist << std::endl;
- }
- else if (x <= ex && y >= ey) {
- esta = 90 - std::atan((x-ex)/(y-ey))* (180.0 / 3.14159265359) - ang - estn;
- //std::cout << "C**********" << " esta = " << esta << " ang = " << ang << " dist = " << dist << std::endl;
- } else if (x >= ex && y <= ey) {
- esta = std::atan((y-ey)/(x-ex))* (180.0 / 3.14159265359) - ang - estn;
- //std::cout << "D**********" << " esta = " << esta << " ang = " << ang << " dist = " << dist << std::endl;
- } else {
- std::cout << "ZAVAR AZ EROBEN" << std::endl;
- }
- }
- }
- float getDist() const {
- return dist;
- }
- float getAng() const {
- return ang;
- }
- float getX() const {
- return x;
- }
- float getY() const {
- return y;
- }
- protected:
- float x, y;
- int time_stamp;
- float dist, ang;
- };
- class SeenBall : public SeenFlag
- {
- public:
- SeenBall(float x = 0, float y = 0):SeenFlag(x, y)
- {};
- friend std::ostream & operator<< (std::ostream & os, SeenBall & sf)
- {
- os << "x: " << sf.x << std::endl;
- os << "y: " << sf.y << std::endl;
- os << "time_stamp: " << sf.time_stamp << std::endl;
- return os;
- }
- void setDistAngDistAng(int time_stamp, float dist, float ang, float edist, float eang) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- this->ang= ang;
- this->edist = edist;
- this->eang= eang;
- }
- protected:
- float edist, eang;
- };
- class SeenPlayer
- {
- public:
- SeenPlayer():
- time_stamp(-1000) // a long time ago
- {};
- friend std::ostream & operator<< (std::ostream & os, SeenPlayer & sf)
- {
- os << "dist: " << sf.dist << std::endl;
- os << "ang: " << sf.ang << std::endl;
- os << "time_stamp: " << sf.time_stamp << std::endl;
- return os;
- }
- int get_time_stamp() const
- {
- return time_stamp;
- }
- void set_time_stamp(int time_stamp)
- {
- this->time_stamp = time_stamp;
- }
- void setDist(int time_stamp, float dist) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- }
- void setAng(int time_stamp, float ang) {
- this->time_stamp = time_stamp;
- this->ang = ang;
- }
- void setDistAng(int time_stamp, float px, float py, float pang, float dist, float ang) {
- this->time_stamp = time_stamp;
- this->dist = dist;
- this->ang= ang;
- this->x = px + std::cos(pang - ang) * dist;
- this->y = py + std::sin(pang - ang) * dist;
- }
- float getDist() const {
- return dist;
- }
- float getAng() const {
- return ang;
- }
- float getX() const {
- return x;
- }
- float getY() const {
- return y;
- }
- bool fwd(char lr, float fromx) const {
- if (lr == 'l') {
- if (fromx < this->x)
- return true;
- else
- return false;
- } else {
- if (fromx > this->x)
- return true;
- else
- return false;
- }
- }
- private:
- float x, y;
- int time_stamp;
- float dist, ang;
- };
- class LobogoLexer : public yyFlexLexer
- {
- public:
- LobogoLexer(int time = 0, int squad_number=0, char lr = 'l'):
- time(time),
- squad_number(squad_number),
- lr(lr)
- {
- own_team = new SeenPlayer[11];
- other_team = new SeenPlayer[11];
- flags = new SeenFlag[Flag::NOF] {
- // halfway line
- // kozepvonal
- // 0: "f c b" see the constants of the class Flag
- {0.0, 34.0},
- // 1: "f c"
- {0.0, 0.0},
- // 2: "f c t"
- {0.0, -34.0},
- // right (east) goal line
- // keleti golvonal
- {52.5, 7.0},
- {52.5, 0.0},
- {52.5, -7.0},
- // left goal line
- // nyugati golvonal
- {-52.5, 7.0},
- {-52.5, 0.0},
- {-52.5, -7.0},
- // right penalty area
- // keleti bunteto
- {36.0, 20.0},
- {36.0, 0.0},
- {36.0, -20.0},
- // left penalty point
- // nyugati bunteto
- {-36.0, 20.0},
- {-36.0, 0.0},
- {-36.0, -20.0},
- // right corner flagpost
- // keleti szoglet
- {52.5, 34.0},
- {52.5, -34.0},
- // east corner flagpost
- // nyugati szoglet
- {-52.5, 34.0},
- {-52.5, -34.0},
- // keleti alapv
- {57.5, 30.0},
- {57.5, 20.0},
- {57.5, 10.0},
- {57.5, 0.0},
- {57.5, -10.0},
- {57.5, -20.0},
- {57.5, -30.0},
- // nyugati alapv
- {-57.5, 30.0},
- {-57.5, 20.0},
- {-57.5, 10.0},
- {-57.5, 0.0},
- {-57.5, -10.0},
- {-57.5, -20.0},
- {-57.5, -30.0},
- // felso oldalv.
- // (Ne felejtsem el, a Java-s verzióban a felső és alsó oldalvonal
- // zászlóinak rosszak a koordinátái, csak az egyik oldalt adják
- // mindig, itt javítva: a második ötös blokk elsője itt már negatív.)
- {50.0, -39.0},
- {40.0, -39.0},
- {30.0, -39.0},
- {20.0, -39.0},
- {10.0, -39.0},
- {0.0, -39.0},
- {-10.0, -39.0},
- {-20.0, -39.0},
- {-30.0, -39.0},
- {-40.0, -39.0},
- {-50.0, -39.0},
- // also oldalv.
- {50.0, 39.0},
- {40.0, 39.0},
- {30.0, 39.0},
- {20.0, 39.0},
- {10.0, 39.0},
- {0.0, 39.0},
- {-10.0, 39.0},
- {-20.0, 39.0},
- {-30.0, 39.0},
- {-40.0, 39.0},
- {-50.0, 39.0}
- };
- };
- int nof_kickin_quantums;
- int nof_possessing_quantums;
- ~LobogoLexer() {
- delete[] flags;
- delete[] own_team;
- delete[] other_team;
- }
- virtual int yylex ();
- friend std::ostream & operator<< (std::ostream & os, LobogoLexer & bl)
- {
- os << "time: " << bl.time << std::endl;
- os << "squad_number: " << bl.squad_number << std::endl;
- os << "lr: " << bl.lr << std::endl;
- return os;
- }
- int get_time() const
- {
- return time;
- }
- char get_lr() const
- {
- return lr;
- }
- int get_squad_number() const
- {
- return squad_number;
- }
- bool get_see_ball() const {
- if (time - ball.get_time_stamp() <4)
- return true;
- else
- return false;
- }
- float get_ball_dist() const {
- return ball.getDist();
- }
- float get_ball_ang() const {
- return ball.getAng();
- }
- // from light response
- float x;
- float y;
- float head_angle; // neck angle (rad)
- float body_angle; // (rad)
- // from classical estimations
- float estx; // x
- float esty; // y
- float esta; // body_angle (deg)
- float estn; // head_angle (deg) (from body_sense/head_angle)
- float d_estx, d_esty;
- float get_estx() const
- {
- return estx;
- }
- float get_esty() const
- {
- return esty;
- }
- float get_esta() const
- {
- return esta;
- }
- void set_estx(float estx)
- {
- this->estx = estx;
- }
- void set_esty(float esty)
- {
- this->esty = esty;
- }
- // See the book "Bátfai Norbert: Mesterséges intelligencia a gyakorlatban: bevezetés
- // a robotfoci programozásba" http://www.inf.unideb.hu/~nbatfai/konyvek/MIRC/mirc.book.xml.pdf
- void gps(float u, float v, float r, float a, float b, float m) {
- float K = r * r - m * m + a * a + b * b - u * u - v * v;
- float oszto = 2.0 * b - 2.0 * v;
- if (oszto == 0.0) {
- return;
- }
- float Z = K / oszto;
- float H = (2.0 * a - 2.0 * u) / oszto;
- float A = 1.0 + H * H;
- float B = 2.0 * v * H - 2.0 * u - 2.0 * Z * H;
- float C = u * u + Z * Z - 2.0 * Z * v + v * v - m * m;
- float diszk = B * B - 4.0 * A * C;
- if (diszk >= 0.0) {
- float gyokalatt = std::sqrt(B * B - 4.0 * A * C);
- if (2.0 * A == 0.0) {
- return;
- }
- float x1 = (-B + gyokalatt) / (2.0 * A);
- float x2 = (-B - gyokalatt) / (2.0 * A);
- float y1 = Z - H * x1;
- float y2 = Z - H * x2;
- //
- float tav1 = (estx - x1) * (estx - x1) + (esty - y1) * (esty - y1);
- float tav2 = (estx - x2) * (estx - x2) + (esty - y2) * (esty - y2);
- if (tav1 < tav2) {
- estx = x1;
- esty = y1;
- } else {
- estx = x2;
- esty = y2;
- }
- }
- }
- static double const PI = 3.14159265359;
- // See the book "Bátfai Norbert: Mesterséges intelligencia a gyakorlatban: bevezetés
- // a robotfoci programozásba" http://www.inf.unideb.hu/~nbatfai/konyvek/MIRC/mirc.book.xml.pdf
- void positioning() {
- int itime = time;
- int smallest = 1000;
- int secondsmallest = 1000;
- float long_dist = 100000.0, dist, secdist = 100000.0, x, y;
- int time_stamp;
- for (int i = 0; i < Flag::NOF; ++i) {
- time_stamp = flags[i].get_time_stamp();
- x = flags[i].getX();
- y = flags[i].getY();
- if (itime - time_stamp < 2) {
- dist = (estx - x) * (estx - x) + (esty - y) * (esty - y);
- if (dist < long_dist) {
- long_dist = secdist;
- secdist = dist;
- secondsmallest = smallest;
- smallest = i;
- }
- }
- }
- if (secondsmallest != 1000) {
- gps(flags[smallest].getX(), flags[smallest].getY(), flags[smallest].getDist(),
- flags[secondsmallest].getX(), flags[secondsmallest].getY(), flags[secondsmallest].getDist());
- if (d_estx != estx || d_esty != esty) {
- /* // ezt az elmozdulás alapú body angle maghatározást
- * // elrontja a pos parancs használata, mert akkor nem arra mozog, amerre a body angle mutat
- if (estx == 0.0) {
- estx = 0.001;
- }
- esta = (std::asin((esty - d_esty) / (estx - d_estx))) * (180.0 / PI);
- */
- d_estx = estx;
- d_esty = esty;
- }
- }
- }
- int pass_to_farthest(int sharp) {
- int itime = time;
- int farthest = -1;
- float small_dist = 0.0001, dist;
- int time_stamp;
- for (int i = 0; i < 11; ++i) {
- time_stamp = own_team[i].get_time_stamp();
- if (itime - time_stamp < sharp) {
- dist = own_team[i].getDist();
- if (dist > small_dist) {
- small_dist = dist;
- farthest = i;
- }
- }
- }
- return farthest;
- }
- int pass_to_nearest(int sharp) {
- int itime = time;
- int nearest = -1;
- float small_dist = 150.0, dist;
- int time_stamp;
- for (int i = 0; i < 11; ++i) {
- time_stamp = own_team[i].get_time_stamp();
- if (itime - time_stamp < sharp) {
- dist = own_team[i].getDist();
- if (dist < small_dist) {
- small_dist = dist;
- nearest = i;
- }
- }
- }
- return nearest;
- }
- int pass_to_farthest_fwd(void) {
- int itime = time;
- int farthest = -1;
- float small_dist = 0.0001, dist;
- int time_stamp;
- for (int i = 0; i < 11; ++i) {
- time_stamp = own_team[i].get_time_stamp();
- if (itime - time_stamp < 2) {
- dist = own_team[i].getDist();
- if (dist > small_dist && own_team[i].fwd(lr, x)) {
- small_dist = dist;
- farthest = i;
- }
- }
- }
- return farthest;
- }
- int tavhozEro(float dist) {
- if (dist < 3.0) {
- return 20;
- } else if (dist < 6.0) {
- return 40;
- } else if (dist < 9.0) {
- return 60;
- } else if (dist < 12.0) {
- return 80;
- } else if (dist < 15.0) {
- return 100;
- } else if (dist < 19.0) {
- return 100;
- } else if (dist < 24.0) {
- return 100;
- } else if (dist < 30.0) {
- return 100;
- } else {
- return 100;
- }
- }
- /*
- int tavhozEro(float dist) {
- if (dist < 3.0) {
- return 10;
- } else if (dist < 6.0) {
- return 20;
- } else if (dist < 9.0) {
- return 30;
- } else if (dist < 12.0) {
- return 40;
- } else if (dist < 15.0) {
- return 50;
- } else if (dist < 19.0) {
- return 60;
- } else if (dist < 24.0) {
- return 70;
- } else if (dist < 30.0) {
- return 80;
- } else {
- return 100;
- }
- }
- */
- int nof_seen_teammates(void) {
- int itime = time;
- int nof = 0;
- float small_dist = 0.0001, dist;
- int time_stamp;
- for (int i = 0; i < 11; ++i) {
- time_stamp = own_team[i].get_time_stamp();
- if (itime - time_stamp < 2) {
- ++nof;
- }
- }
- return nof;
- }
- void setTeam(const std::string & team) {
- this->team = team;
- }
- SeenPlayer & get_own_player(int i) {
- return own_team[i];
- }
- SeenFlag & get_flag(int i) {
- return flags[i];
- }
- SeenBall & get_ball() {
- return ball;
- }
- RefereePlayMode & get_play_mode() {
- return play_mode;
- }
- private:
- SeenBall ball;
- // The flags that are seen by the player.
- SeenFlag * flags;
- // The teammates
- SeenPlayer * own_team;
- // The opponent players
- SeenPlayer * other_team;
- // teamname
- std::string team;
- char teamname_buffer[128];
- //
- int squadnumber_buffer;
- float dist_buffer, ang_buffer;
- float dist_buffer2, ang_buffer2;
- // hear
- char hear_buffer[1024];
- char sender_buffer[128];
- //
- RefereePlayMode play_mode;
- // see, sense_body
- int time;
- // init
- int squad_number;
- char lr;
- // nocopyable
- LobogoLexer (const LobogoLexer &);
- LobogoLexer & operator= (const LobogoLexer &);
- };
- class Coach
- {
- public:
- Coach(int formi = 0):formi(formi)
- {
- if (formi >= Formations::NOF || formi <0)
- formi = 0;
- formations = new Formation[Formations::NOF] {
- // (a +--os megadásokkal már tisztára FerSML feeling)
- // 4_3_3 h
- {-51, 0,
- // att
- -4, 10, -1, 0, -3, -11,
- // mid
- -18, -16, -17, 2, -18, 17,
- // def
- -35, -19, -33, -10, -34, 12, -35, 24},
- // 4_3_3 f
- { /*-40, -9,*/ -49, 0,
- // att
- -4 + 40, 10, -1 + 45, 1, -3 + 40, -11,
- // mid
- -18 + 23, -16, -17 + 12 , 2, -18 + 25, 17,
- // def
- -40, -13, -31, -8, -32, 9, -40, 14},
- // 4_4_2 h
- {-51, 0,
- // att
- -4, 6, -3, -6,
- // mid
- -18, -19, -17, -10, -17, 12, -18, 24,
- // def
- -35, -19, -33, -10, -34, 12, -35, 24},
- // 4_4_2 f
- {-50, 0,
- // att
- -4 + 40, 6, -3 + 40, -6,
- // mid
- -18 + 30, -19, -17 + 25, -10, -17 + 25, 12, -18 + 30, 24,
- // def
- -35, -19, -33, -10, -34, 12, -35, 24},
- {//h
- -44, 0,
- -15, -25, -4, 0, -33, -29, -35, -9, -22 , -9, -15, 0,
- -35, 9, -22, 9, -33, 29, -15, 25
- },
- {//f
- -42, 0,
- -25, -36, 0, -11, 0, 11, -25, -9, -25, 9, -25, 36, 20, -21, 20, 21, 20, 0, 44, 0
- },
- {
- -27, 0,
- -35, -12, //1
- -17, -12, //2
- -12, 5, //3
- -27, 17, //4
- -41, 5, //5
- -27, -5, //6
- -21, -1, //7
- -23, 5, //8
- -30, 5, //9
- -32, -1 //10
- },
- {
- -27, 0,
- -30, -5, //9
- -23, -5, //8
- -21, 1, //7
- -27, 5, //6
- -32, 1, //10
- -27, -17, //4
- -12, -5, //3
- -17, 12, //2
- -35, 12, //1
- -41, -5 //5
- },
- // c a
- {-50, 0,
- // att
- -4 + 40 +8 , 6, -3 + 40 +8, -6,
- // mid
- -18 + 30 +30, -19, -17 + 25 +35, -10, -17 + 25+35, 12, -18 + 30 +30, 24,
- // def
- -35 +20, -19, -33+15, -7, -34+15, 8, -35+20, 24},
- // c d
- {-50, 0,
- // att
- -4 - 40, 6, -3 - 40, -6,
- // mid
- -18 - 30 , -19, -17 - 25 , -10, -17 - 25, 12, -18 - 30 , 24,
- // def
- -35 -15,-19, -52, -8, -52, 8, -35 -15, 24}
- };
- }
- ~Coach() {
- delete[] formations;
- }
- Formation & get_formation() const
- {
- return formations[formi];
- }
- void set_formation(int formi)
- {
- this->formi = formi;
- }
- private:
- //
- Formation * formations;
- int formi;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement