C-Engine/include/Object.hpp

86 lines
2.2 KiB
C++
Raw Permalink Normal View History

2016-06-09 17:07:38 +02:00
/* ************************************************************************** */
2016-06-10 15:28:40 +02:00
/* _____ _ __ ___ __ */
/* Object.hpp | ___(_)/ _| ___ ( _ ) / /_ */
/* Project: C-Engine | |_ | | |_ / _ \/ _ \| '_ \ */
/* | _| | | _| __/ (_) | (_) | */
/* Author: Fife <wasabifife@gmail.com> |_| |_|_| \___|\___/ \___/ */
2016-06-09 17:07:38 +02:00
/* */
/* ************************************************************************** */
#ifndef CENGINE_OBJECT_HPP
#define CENGINE_OBJECT_HPP
#include "..\C-Engine\CEngine.hpp"
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
class Object
{
public:
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
Object(); //Constructeur
~Object();
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
void AffectEngine(Engine * EV);
void AffectScript(Script * SV);
void AffectTag(char * v);
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
void Enable();
void Disable();
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
void AddRigidBody(); //Ajout un RigidBody
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
//Accesseur
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
Engine * GetEngine();
Transform * GetTransform();
RigidBody * GetRigidBody();
Render * GetRender();
Script * GetScript();
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
char * GetTag();
bool GetEnable();
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
//Fonction pour les scripts
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
Object * GetObjectCollisionTag( char* v , int x = 0 , int y = 0);
bool GetCollisionTag( char * v , int x = 0 , int y = 0 );
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
bool IsOnScreen();
bool Collision(int id , Level * l = NULL);
2016-06-14 15:39:24 +02:00
bool TestTag(char * v);
2016-06-09 17:07:38 +02:00
2016-06-14 15:39:24 +02:00
protected:
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
Transform * OTransform;
Render * ORender;
RigidBody * ORigidBody;
Script * OScript;
Engine * Conteneur;
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
char * tag;
bool enable;
2016-06-09 17:07:38 +02:00
2016-06-10 15:28:40 +02:00
};
2016-06-09 17:07:38 +02:00
2016-06-14 15:39:24 +02:00
class Trigger: public Object
{
public:
Trigger(); //Constructeur
~Trigger();
void CreateTrigger(int x , int y , int width , int height );
2016-06-15 19:22:20 +02:00
void SetDestination(int x , int y , int level , char * onlypass = NULL);
2016-06-14 15:39:24 +02:00
Vec2 GetDestination();
int GetDestinationLevel();
2016-06-15 19:22:20 +02:00
char * GetPass();
2016-06-14 15:39:24 +02:00
private:
Vec2 destination;
int leveldestination;
2016-06-15 19:22:20 +02:00
char * pass;
2016-06-14 15:39:24 +02:00
};
2016-06-09 17:07:38 +02:00
#endif