forked from jaildesigner-jailgames/jaildoctors_dilemma
Commit to continue on other pc
This commit is contained in:
73
source/smartsprite.h
Normal file
73
source/smartsprite.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
#include "utils.h"
|
||||
#include "animatedsprite.h"
|
||||
|
||||
#ifndef SMARTSPRITE_H
|
||||
#define SMARTSPRITE_H
|
||||
|
||||
// Clase SmartSprite
|
||||
class SmartSprite : public AnimatedSprite
|
||||
{
|
||||
private:
|
||||
bool mEnabled; // Indica si esta habilitado
|
||||
bool mIsOnDestination; // Indica si está en el destino
|
||||
int mDestX; // Posicion de destino en el eje X
|
||||
int mDestY; // Posicion de destino en el eje Y
|
||||
int mId; // Identificador
|
||||
Uint16 mEnabledCounter; // Contador para deshabilitarlo
|
||||
Uint8 *mIntroEvents; // Dirección del array de eventos donde notificar el estado
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
SmartSprite();
|
||||
|
||||
// Destructor
|
||||
~SmartSprite();
|
||||
|
||||
// Inicializador
|
||||
void init(LTexture *texture, SDL_Renderer *renderer);
|
||||
|
||||
// Pone a cero los elementos del objeto
|
||||
void erase();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool isEnabled();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabled(bool state);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
Uint16 getEnabledTimer();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabledTimer(Uint16 time);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setDestX(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setDestY(int value);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int getDestX();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int getDestY();
|
||||
|
||||
// Actualiza la posición y comprueba si ha llegado a su destino
|
||||
bool update();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool isOnDestination();
|
||||
|
||||
// Pinta el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setId(int id);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setIntroEvents(Uint8 *value);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user