diff --git a/ch-7-object-oriented-design/louis/.classpath b/ch-7-object-oriented-design/louis/.classpath new file mode 100644 index 0000000..adeb0a3 --- /dev/null +++ b/ch-7-object-oriented-design/louis/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ch-7-object-oriented-design/louis/.gitignore b/ch-7-object-oriented-design/louis/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/ch-7-object-oriented-design/louis/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/ch-7-object-oriented-design/louis/.project b/ch-7-object-oriented-design/louis/.project new file mode 100644 index 0000000..ab19bcb --- /dev/null +++ b/ch-7-object-oriented-design/louis/.project @@ -0,0 +1,17 @@ + + + DeckOfCards + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/ch-7-object-oriented-design/louis/src/deckofcards/BlackJack.java b/ch-7-object-oriented-design/louis/src/deckofcards/BlackJack.java new file mode 100644 index 0000000..a6040a8 --- /dev/null +++ b/ch-7-object-oriented-design/louis/src/deckofcards/BlackJack.java @@ -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; + } + +} diff --git a/ch-7-object-oriented-design/louis/src/deckofcards/Card.java b/ch-7-object-oriented-design/louis/src/deckofcards/Card.java new file mode 100644 index 0000000..4bf6ae0 --- /dev/null +++ b/ch-7-object-oriented-design/louis/src/deckofcards/Card.java @@ -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; + } + + + +} diff --git a/ch-7-object-oriented-design/louis/src/deckofcards/Deck.java b/ch-7-object-oriented-design/louis/src/deckofcards/Deck.java new file mode 100644 index 0000000..6d47dd8 --- /dev/null +++ b/ch-7-object-oriented-design/louis/src/deckofcards/Deck.java @@ -0,0 +1,13 @@ +package deckofcards; + +import java.util.ArrayList; + +public class Deck { + + + private ArrayList Card; + + public Deck(ArrayList c) { + this.Card = c; + } +} diff --git a/ch-7-object-oriented-design/louis/src/deckofcards/Suit.java b/ch-7-object-oriented-design/louis/src/deckofcards/Suit.java new file mode 100644 index 0000000..8263890 --- /dev/null +++ b/ch-7-object-oriented-design/louis/src/deckofcards/Suit.java @@ -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; + } + + +} diff --git a/ch-7-object-oriented-design/louis/src/module-info.java b/ch-7-object-oriented-design/louis/src/module-info.java new file mode 100644 index 0000000..d1feb5b --- /dev/null +++ b/ch-7-object-oriented-design/louis/src/module-info.java @@ -0,0 +1,2 @@ +module DeckOfCards { +} \ No newline at end of file