-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSingle.cpp
More file actions
36 lines (34 loc) · 759 Bytes
/
Single.cpp
File metadata and controls
36 lines (34 loc) · 759 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
#include <iostream>
#include <string>
#include <vector>
#include "Card.h"
#include "Single.h"
using namespace std;
Single::Single(Card &a)
{
maxCard=&a;
minCard=&a;
//kindcode=1;
}
//contructor of the class Single
int Single::CompareSingle(Single A,Single B)
{
if((A.maxCard->value)>(B.maxCard->value))
return 1;
else if((A.maxCard->value)<(B.maxCard->value))
return 0;
else
return -1;
}
//compare 2 single.maxCard.value, if former is bigger, return 1 , if latter is bigger, return 0.
//And if the values are the same, return (error message) -1
string Single::toString()
{
return maxCard->toString();
}
void Single::swap(Single& a,Single& b)
{
Single tmp=a;
a=b;
b=tmp;
}