Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ch-7-object-oriented-design/louis/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions ch-7-object-oriented-design/louis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions ch-7-object-oriented-design/louis/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DeckOfCards</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
16 changes: 16 additions & 0 deletions ch-7-object-oriented-design/louis/src/deckofcards/BlackJack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package deckofcards;

public class BlackJack extends Card {

public BlackJack(int fv, Suit s) {
super(fv, s);
// TODO Auto-generated constructor stub
}

@Override
public int value() {
// TODO Auto-generated method stub
return 0;
}

}
24 changes: 24 additions & 0 deletions ch-7-object-oriented-design/louis/src/deckofcards/Card.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package deckofcards;

public abstract class Card {

private int faceValue;
private Suit suit;


public Card(int fv,Suit s) {

this.faceValue = fv;
this.suit = s;

}

public abstract int value();

public Suit getSuit() {
return suit;
}



}
13 changes: 13 additions & 0 deletions ch-7-object-oriented-design/louis/src/deckofcards/Deck.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package deckofcards;

import java.util.ArrayList;

public class Deck <T extends Card> {


private ArrayList<T> Card;

public Deck(ArrayList<T> c) {
this.Card = c;
}
}
20 changes: 20 additions & 0 deletions ch-7-object-oriented-design/louis/src/deckofcards/Suit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package deckofcards;

public enum Suit {

Heart(0), Spade(1),Diamond(2),Club(3);

private int value;

Suit(int v) {
// TODO Auto-generated constructor stub

this.value = v;
}

public int getValue() {
return value;
}


}
2 changes: 2 additions & 0 deletions ch-7-object-oriented-design/louis/src/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module DeckOfCards {
}