generated from MaracatronicsRobotics/Armorial-PSEL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c5e040
commit 9225dec
Showing
9 changed files
with
176 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "gk_control.h" | ||
|
||
gk_control::gk_control(WorldMap *worldMap) | ||
{ | ||
_worldMap = worldMap; | ||
_player = nullptr; | ||
} | ||
|
||
void gk_control::setPlayer (Player *player) | ||
{ | ||
_player = player; | ||
} | ||
|
||
void gk_control::defend() | ||
{ | ||
if(_player != nullptr){ | ||
_player->goTo(_worldMap->ourGoalCenter()); | ||
_player->rotateTo(_worldMap->ballPosition()); | ||
} | ||
} | ||
|
||
void gk_control::pass(QVector2D target) | ||
{ | ||
//faz o passe para um player especifico | ||
if(_player != nullptr){ | ||
_player ->goTo(target);// | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef GK_CONTROL_H | ||
#define GK_CONTROL_H | ||
|
||
#include <src/entities/player/player.h> | ||
#include <src/entities/worldmap/worldmap.h> | ||
|
||
class gk_control | ||
{ | ||
public: | ||
|
||
gk_control(WorldMap *worldMap); | ||
|
||
void setPlayer(Player *player); | ||
void defend(); | ||
void pass(QVector2D target); | ||
|
||
QVector2D getGoalCircleCenter(); | ||
|
||
private: | ||
Player *_player; | ||
WorldMap *_worldMap; | ||
|
||
}; | ||
|
||
#endif // GK_CONTROL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters