Dobra, poradziłem sobie z tym problemem, rozwijam dalej program, ale nie rozumiem kolejnego błędu:
"eLight'': "class" wpisz ponownie definicję
Kod jest raczej napisany poprawnie:
Plik eLight.h:
#ifndef eLight_hpp
#define eLight_hpp
class eLight{
public:
eLight();
~eLight();
void ePrint(short int X, short int Y, short int Delay, char String[256]);
void SetColor();
void Clear();
void Pause();
};
#endif
Plik eLight.cpp:
#include <iostream> //For Input and Output.
using namespace std;
#include <Windows.h> //For system(), sleep(), coordinates and other function's.
#include "eLight.h" //Header.
class eLight{
public:
eLight(){
cout << "eLight engine loaded!" << endl;
}
~eLight(){
cout << "eLight engine destroyed!" << endl;
}
void ePrint(short int X, short int Y, short int Delay, char String[256]){
COORD coord;
coord.X = X; coord.Y = Y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
short int Counter = 0;
while(String[Counter] != '\0'){
Sleep(Delay);
cout << String[Counter];
Counter++;
}
coord.X = 0; coord.Y = 0;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void SetColor(){
//TODO
}
void Clear(){
system("cls");
}
void Pause(){
system("pause");
}
};
Bałem się wstawić kod bo się trochę wstydziłem :<