-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCard.h
37 lines (29 loc) · 895 Bytes
/
Card.h
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
#ifndef _CARD_H_
#define _CARD_H_
#include<iostream>
// 1 2 3 4
//suits {clubs, hearts, spades, diamonds};
class Card
{
protected:
int x_pos, y_pos, w, h;
int suit, val;
public:
Card(){val = -1; suit = 0;}
//Constructor
Card(int v, int s){if(v >= 0 && v <= 12) val = v; if(s >= 1 && s <= 4) suit = s;}
bool mouse_over(int x,int y); //mouse x and mouse y
//Helpers for getting protc. vals
int get_x() { return x_pos; }
int get_y() { return y_pos; }
int get_w() { return w; }
int get_h() { return h; }
int get_val () {return val;}
int get_suit () {return suit;}
//"Set" Helpers
void set_suit (int s) {suit = s;}
void set_val (int v) {if(v >= 0 && v <= 12) val = v; else val = -1;}
void set_pos(int x, int y, int width, int height){w = width; h = height; x_pos = x; y_pos = y;}
Card& operator = (Card&);
};
#endif //_CARD_H_