Skip to content
GitLab
Explore
Sign in
Register
Show whitespace changes
Inline
Side-by-side
PlayCard/src/main/java/com/mycompany/playcard/jeu52cartes.java
0 → 100644
View file @
d80af6c7
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
com.mycompany.playcard
;
import
java.util.HashSet
;
import
java.util.Objects
;
/**
*
* @author stag
*/
public
class
jeu52cartes
{
private
final
HashSet
<
CarteAJouer
>
jeu
;
public
jeu52cartes
()
{
jeu
=
new
HashSet
<>();
for
(
int
symbole
=
1
;
symbole
<=
4
;
symbole
++)
{
for
(
int
hauteur
=
0
;
hauteur
<
13
;
hauteur
++)
{
jeu
.
add
(
new
CarteAJouer
(
hauteur
,
symbole
));
}
}
}
@Override
public
int
hashCode
()
{
int
hash
=
5
;
return
hash
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
final
jeu52cartes
other
=
(
jeu52cartes
)
obj
;
return
Objects
.
equals
(
this
.
jeu
,
other
.
jeu
);
}
}
Prev
1
2
Next