<commit_before>// Authors: see AUTHORS.md at project root.
// CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
// URL: https://github.com/asrob-uc3m/robotDevastation

#include "MockRobotManager.hpp"

#include <ColorDebug.hpp>

const int rd::MockRobotManager::NONE = 0;
const int rd::MockRobotManager::FORWARD = 1;
const int rd::MockRobotManager::BACKWARDS = 2;
const int rd::MockRobotManager::LEFT = 3;
const int rd::MockRobotManager::RIGHT = 4;

const int rd::MockRobotManager::CAMERA_NONE = 5;
const int rd::MockRobotManager::CAMERA_DOWN = 6;
const int rd::MockRobotManager::CAMERA_UP = 7;
const int rd::MockRobotManager::CAMERA_LEFT = 8;
const int rd::MockRobotManager::CAMERA_RIGHT = 9;

rd::MockRobotManager::MockRobotManager(const std::string& robotName)
{
    this->robotName = robotName;
    movement_direction = NONE;
    camera_movement_direction = CAMERA_NONE;
}

bool rd::MockRobotManager::moveForward(double value)
{
    if(value > 0)
        movement_direction = FORWARD;
    else if(value < 0)
        movement_direction = BACKWARDS;
    else
        movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::turnLeft(double value)
{
    if(value > 0)
        movement_direction = LEFT;
    else if(value < 0)
        movement_direction = RIGHT;
    else
        movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::stopMovement()
{
    movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::tiltDown(double value)
{
    if(value > 0)
        camera_movement_direction = CAMERA_DOWN;
    else if(value < 0)
        camera_movement_direction = CAMERA_UP;
    else
        camera_movement_direction = CAMERA_NONE;
    return true;
}

bool rd::MockRobotManager::panLeft(double value)
{
    if(value > 0)
        movement_direction = CAMERA_LEFT;
    else if(value < 0)
        movement_direction = CAMERA_RIGHT;
    else
        movement_direction = CAMERA_NONE;
    return true;
}

bool rd::MockRobotManager::stopCameraMovement()
{
    camera_movement_direction = CAMERA_NONE;
    return true;
}
        
bool rd::MockRobotManager::isMoving() const
{
    return movement_direction!=NONE;
}

int rd::MockRobotManager::getMovementDirection()
{
    return movement_direction;
}

bool rd::MockRobotManager::isCameraMoving()
{<commit_msg>fix bug: panLeft refers to camera<commit_after>// Authors: see AUTHORS.md at project root.
// CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
// URL: https://github.com/asrob-uc3m/robotDevastation

#include "MockRobotManager.hpp"

#include <ColorDebug.hpp>

const int rd::MockRobotManager::NONE = 0;
const int rd::MockRobotManager::FORWARD = 1;
const int rd::MockRobotManager::BACKWARDS = 2;
const int rd::MockRobotManager::LEFT = 3;
const int rd::MockRobotManager::RIGHT = 4;

const int rd::MockRobotManager::CAMERA_NONE = 5;
const int rd::MockRobotManager::CAMERA_DOWN = 6;
const int rd::MockRobotManager::CAMERA_UP = 7;
const int rd::MockRobotManager::CAMERA_LEFT = 8;
const int rd::MockRobotManager::CAMERA_RIGHT = 9;

rd::MockRobotManager::MockRobotManager(const std::string& robotName)
{
    this->robotName = robotName;
    movement_direction = NONE;
    camera_movement_direction = CAMERA_NONE;
}

bool rd::MockRobotManager::moveForward(double value)
{
    if(value > 0)
        movement_direction = FORWARD;
    else if(value < 0)
        movement_direction = BACKWARDS;
    else
        movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::turnLeft(double value)
{
    if(value > 0)
        movement_direction = LEFT;
    else if(value < 0)
        movement_direction = RIGHT;
    else
        movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::stopMovement()
{
    movement_direction = NONE;
    return true;
}

bool rd::MockRobotManager::tiltDown(double value)
{
    if(value > 0)
        camera_movement_direction = CAMERA_DOWN;
    else if(value < 0)
        camera_movement_direction = CAMERA_UP;
    else
        camera_movement_direction = CAMERA_NONE;
    return true;
}

bool rd::MockRobotManager::panLeft(double value)
{
    if(value > 0)
        camera_movement_direction = CAMERA_LEFT;
    else if(value < 0)
        camera_movement_direction = CAMERA_RIGHT;
    else
        camera_movement_direction = CAMERA_NONE;
    return true;
}

bool rd::MockRobotManager::stopCameraMovement()
{
    camera_movement_direction = CAMERA_NONE;
    return true;
}
        
bool rd::MockRobotManager::isMoving() const
{
    return movement_direction!=NONE;
}

int rd::MockRobotManager::getMovementDirection()
{
    return movement_direction;
}

bool rd::MockRobotManager::isCameraMoving()
{
{'fraction_non_alphanumeric': 0.1037555697008275, 'fraction_numerical': 0.008911521323997454, 'mean_word_length': 4.112798264642082, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4544590', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1579, 'n_words': 337}