Bien sigue así

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#ifndef _AREAHPP_
#define _AREAHPP_
struct Area {
int x;
int y;
int w;
int h;
};
#endif
#ifndef _CAMARAHPP_
#define _CAMARAHPP_
#include "area.hpp"
#include <iostream>
using namespace std;
class CamaraGame{
private:
Area CArea;
int LW;
int LH;
public:
CamaraGame(int _mw,int _mh,int _x,int _y,int _h,int _w);
bool Move(int x,int y);
bool ResizeLimit(int _lw,int _lh);
Area Get();
};
#endif
camara.cpp#include "camara.hpp"
//
CamaraGame::CamaraGame(int _mw,int _mh,int _x,int _y,int _w,int _h){
if(_x>=0)CArea.x=_x;
else {
CArea.x=0;
cout << "\nERROR CAMARA 0007: valor inferior a 0, se le asigna 0\n";
}
if(_y>=0)CArea.y=_y;
else {
CArea.y=0;
cout << "\nERROR CAMARA 0008: valor inferior a 0, se le asigna 0\n";
}
if(_w>=0)CArea.w=_w;
else {
CArea.w=0;
cout << "\nERROR CAMARA 0009: valor inferior a 0, se le asigna 0\n";
}
if(_h>=0)CArea.h=_h;
else {
CArea.h=0;
cout << "\nERROR CAMARA 0010: valor inferior a 0, se le asigna 0\n";
}
if(_mw>=0)LW=_mw;
else {
LW=0;
cout << "\nERROR CAMARA 0011: valor inferior a 0, se le asigna 0\n";
}
if(_mh>=0)LH=_mh;
else {
LH=0;
cout << "\nERROR CAMARA 0012: valor inferior a 0, se le asigna 0\n";
}
};
bool CamaraGame::Move(int _x,int _y){
if(_x<0){
_x=0;
cout << "\nERROR CAMARA 0003: valor inferior a 0, se le asigna 0\n";
}
if(_y<0){
_y=0;
cout << "\nERROR CAMARA 0004: valor inferior a 0, se le asigna 0\n";
}
if(_x+CArea.w>LW){
_x=LW-CArea.w;
cout << "\nERROR CAMARA 0005: valor superior a lo permitido se le asigna " << _x << "\n";
}
if(_y+CArea.h>LH){
_y=LH-CArea.h;
cout << "\nERROR CAMARA 0006: valor superior a lo permitido se le asigna " << _y << "\n";
}
CArea.x=_x;
CArea.y=_y;
return true;
}
bool CamaraGame::ResizeLimit(int _w,int _h){
if(_w>=0)LW=_w;
else {
LW=0;
cout << "\nERROR CAMARA 0001: valor inferior a 0, se le asigna 0\n";
}
if(_h>=0 )LH=_h;
else {
LH=0;
cout << "\nERROR CAMARA 0002: valor inferior a 0, se le asigna 0\n";
}
return true;
}
Area CamaraGame::Get(){
return CArea;
}