forked from jaildesigner-jailgames/coffee_crisis
release v1.3 beta 1
This commit is contained in:
84
source/smartsprite.h
Normal file
84
source/smartsprite.h
Normal file
@@ -0,0 +1,84 @@
|
||||
#pragma once
|
||||
#include "struct.h"
|
||||
#include "animatedsprite.h"
|
||||
|
||||
#ifndef SMARTSPRITE_H
|
||||
#define SMARTSPRITE_H
|
||||
|
||||
// Clase SmartSprite
|
||||
class SmartSprite : public AnimatedSprite
|
||||
{
|
||||
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);
|
||||
|
||||
private:
|
||||
// Indica si esta habilitado
|
||||
bool mEnabled;
|
||||
|
||||
// Contador
|
||||
Uint16 mEnabledTimer;
|
||||
|
||||
// Indica si está en el destino
|
||||
bool mIsOnDestination;
|
||||
|
||||
// Posicion de destino
|
||||
int mDestX;
|
||||
int mDestY;
|
||||
|
||||
// Identificador
|
||||
int mId;
|
||||
|
||||
// Dirección del array de eventos donde notificar el estado
|
||||
Uint8 *mIntroEvents;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user