-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLista.cpp
More file actions
50 lines (47 loc) · 950 Bytes
/
Lista.cpp
File metadata and controls
50 lines (47 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "Lista.h"
#include <iostream>
using namespace std;
Lista::Lista()
{
this->inicio = NULL;
}
void Lista::agregarCarta(Carta* nueva){
if(inicio==NULL)
{
inicio = nueva;
}else{
Carta* temp = inicio;
while(temp->siguiente!=NULL)
temp = temp->siguiente;
temp->siguiente = nueva;
}
}
bool Lista::validacion(Carta *nueva){
}
void Lista::agregarCartas(Carta* nueva){
Carta* temp = inicio;
while(temp->siguiente!=NULL)
temp = temp->siguiente;
temp->siguiente = nueva;
}
void Lista::imprimirLista(SDL_Surface* screen, int x){
Carta* temp = inicio;
int contador = 160;
while(temp!=NULL){
SDL_Rect offset;
offset.x = x;
offset.y = contador;
if(temp->siguiente==NULL||temp->cara==true){
SDL_BlitSurface( temp->imagen, NULL, screen, &offset );
temp->cara = true;
}
else
SDL_BlitSurface( temp->bak, NULL, screen, &offset );
temp = temp->siguiente;
contador = contador + 20;
}
}
Lista::~Lista()
{
//dtor
}