change function definition

This commit is contained in:
ackimixs
2024-04-17 10:53:32 +02:00
parent d307e46e68
commit 829fbedb72
3 changed files with 6 additions and 6 deletions

View File

@@ -267,7 +267,7 @@ void TCPServer::broadcastMessage(const char* message, int senderSocket)
}
void TCPServer::broadcastMessage(std::string &message, int senderSocket) {
if (!TCPUtils::endsWith(message, "\n")) {
if (!TCPUtils::endWith(message, "\n")) {
message += "\n";
}
@@ -404,7 +404,7 @@ void TCPServer::startGameBlueTeam() {
bool found = false;
while (!found) {
for (const auto & arucoTag : this->arucoTags) {
if (TCPUtils::endsWith(arucoTag.name(), "flower")) {
if (TCPUtils::endWith(arucoTag.name(), "flower")) {
if (arucoTag.pos().first[0] < 800 && arucoTag.pos().first[0] > 300 && arucoTag.pos().first[1] < 300 && arucoTag.pos().first[1] > -300) {
tag = arucoTag;
found = true;
@@ -444,7 +444,7 @@ void TCPServer::startGameBlueTeam() {
found = false;
while (!found) {
for (const auto & arucoTag : this->arucoTags) {
if (TCPUtils::endsWith(arucoTag.name(), "flower")) {
if (TCPUtils::endWith(arucoTag.name(), "flower")) {
if (arucoTag.pos().first[0] < 800 && arucoTag.pos().first[0] > 300 && arucoTag.pos().first[1] < 300 && arucoTag.pos().first[1] > -300) {
tag = arucoTag;
found = true;
@@ -484,7 +484,7 @@ void TCPServer::startGameBlueTeam() {
found = false;
while (!found) {
for (const auto & arucoTag : this->arucoTags) {
if (TCPUtils::endsWith(arucoTag.name(), "flower")) {
if (TCPUtils::endWith(arucoTag.name(), "flower")) {
if (arucoTag.pos().first[0] < 800 && arucoTag.pos().first[0] > 300 && arucoTag.pos().first[1] < 300 && arucoTag.pos().first[1] > -300) {
tag = arucoTag;
found = true;

View File

@@ -5,7 +5,7 @@ bool TCPUtils::startWith(const std::string& str, const std::string& start)
return str.rfind(start, 0) == 0;
}
bool TCPUtils::endsWith(const std::string& str, const std::string& end)
bool TCPUtils::endWith(const std::string& str, const std::string& end)
{
if (str.length() >= end.length())
{

View File

@@ -13,7 +13,7 @@ enum PinceState {
namespace TCPUtils {
bool startWith(const std::string& str, const std::string& start);
bool endsWith(const std::string& str, const std::string& end);
bool endWith(const std::string& str, const std::string& end);
bool contains(const std::string& str, const std::string& sub);