Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #8

Open
wants to merge 34 commits into
base: frehburg-patch-21.9.000
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d29ebe3
Add files via upload
theblaggy Sep 21, 2018
33bd2cc
Add files via upload
theblaggy Sep 21, 2018
35a9265
Comments & Style Improved
theblaggy Sep 21, 2018
406b2a6
Comments & Style Improved
theblaggy Sep 21, 2018
dd9ba2e
Added win screen
theblaggy Sep 21, 2018
d2f1a3b
Comments & Style Improved
theblaggy Sep 21, 2018
abd8033
Replaced the missplaced chips
theblaggy Sep 21, 2018
0413090
Replaced Text Label
theblaggy Sep 21, 2018
09717e8
Delete Button_stand.png
theblaggy Sep 22, 2018
e1ca438
Delete Button_stand1.png
theblaggy Sep 22, 2018
0517401
Added .gitignore
theblaggy Sep 22, 2018
39a4609
Centered Start Label
theblaggy Sep 22, 2018
45c864d
Replaced old gameloop with the new lightweight gamelogic
theblaggy Sep 22, 2018
005f240
Added missing comments
theblaggy Sep 22, 2018
bd4921d
Added Class Diagram.xml
theblaggy Sep 22, 2018
f3df5ca
Update Class Diagram.xml
theblaggy Sep 22, 2018
7f10680
Update Class Diagram.xml
theblaggy Sep 22, 2018
fd2ab42
Update Class Diagram.xml
theblaggy Sep 22, 2018
9cdb4ef
Added Class Diagram.xml
theblaggy Sep 22, 2018
12d340e
Add files via upload
theblaggy Sep 22, 2018
d223365
Delete Untitled Diagram.xml
theblaggy Sep 22, 2018
de7deed
I don´t know
theblaggy Sep 22, 2018
ffad1d0
Merge branch 'the-blaggyS-patch-1' of https://github.com/the-blaggyS/…
theblaggy Sep 22, 2018
f745cd3
Renamed ClassDiagram
theblaggy Sep 22, 2018
8c112da
Added Class DIagram to Readme
theblaggy Sep 22, 2018
beada41
Added ClassDiagram.xml
theblaggy Sep 22, 2018
b0377d5
Delete Class Diagram.xml
theblaggy Sep 22, 2018
8046fde
Added files via upload
theblaggy Sep 22, 2018
c4d0138
New Card Stacks is created, when the current one runs ouf of cards
theblaggy Sep 23, 2018
04a5c99
Update README.md
theblaggy Sep 23, 2018
374301e
Update ClassDiagram.xml
theblaggy Sep 23, 2018
8afa768
Updated ClassDiagram.png
theblaggy Sep 23, 2018
b82ccf5
Added ClassDiagramNoGUI.xml
theblaggy Sep 24, 2018
7382a4b
Add files via upload
frehburg Sep 24, 2018
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
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
27 changes: 12 additions & 15 deletions Application.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;

import java.awt.CardLayout;

/**
* Creates JFrame and adds the Game
* Creates JFrame and adds Menu & Game
*
* @author Lucas
*/
public class Application extends JFrame
{
JPanel cards;
JPanel cardMenu;
JPanel cardGame;

/**
* Creates the Menu and Game card and sets attributes
*/
public Application()
{
cardMenu = new Menu(this);
Expand All @@ -29,23 +35,14 @@ public Application()
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
}

/**
* Changes the Menu card to the Game card
*/
public void changeCard() {
CardLayout cl = (CardLayout)(cards.getLayout());
cl.show(cards, "GAME");
pack();
setLocationRelativeTo(null);
}
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
{
Application app = new Application();
app.setVisible(true);
}
}
);
}
}
10 changes: 8 additions & 2 deletions Automation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
import java.awt.event.*;
import javax.swing.*;

/**
* Automation is a support class to refresh the panel Game automatically
*
* @author Lucas
*/
public class Automation extends JPanel implements ActionListener
{
Game game;
private Game game;
public Automation(Game game)
{
this.game = game;
Expand All @@ -13,6 +18,7 @@ public Automation(Game game)

public void actionPerformed(ActionEvent e)
{
game.gameloop(-1);
game.gamelogic();
game.redrawUI();
}
}
Binary file removed Button_stand.png
Binary file not shown.
Binary file removed Button_stand1.png
Binary file not shown.
32 changes: 25 additions & 7 deletions Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,31 @@
import javax.swing.JLabel;

/**
* Write a description of class Card here.
*
* @author Lucas & Filip
* @version 18.09.
* Implements a playing card with suit and rank
* rank and suite are handled iternaly as integers
*
* @author Lucas
*/
public class Card
{
private int suite;
private int rank;
private ImageIcon icon;
private boolean flag_lower = false;
private boolean flagLower = false;

/**
* Sets suite, rank and icon
*/
public Card(int pSuite, int pRank)
{
suite = pSuite;
rank = pRank;
icon = new ImageIcon(new ImageIcon("src/resources/Playing_card_" + getSuite() + "_" + getRank() + ".png").getImage().getScaledInstance(120, 180, Image.SCALE_SMOOTH));
}

/**
* Returns suite
*/
public String getSuite()
{
switch(suite) {
Expand All @@ -41,6 +47,9 @@ public String getSuite()
return "";
}

/**
* Returns rank
*/
public String getRank()
{
switch(rank) {
Expand Down Expand Up @@ -74,26 +83,35 @@ public String getRank()
return "";
}

/**
* Returns rank as integer
*/
public int getNumber()
{
if (rank > 10)
{
return 10;
}
if (rank == 1 && !flag_lower)
if (rank == 1 && !flagLower)
{
return 11;
}
return rank;
}

/**
* Returns icon
*/
public ImageIcon getIcon()
{
return icon;
}

/**
* Sets Ace from 11 to 1
*/
public void setLower()
{
flag_lower = true;
flagLower = true;
}
}
Binary file added ClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ClassDiagram.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0" version="9.1.8" editor="www.draw.io" type="github"><diagram id="3775ebc4-31d6-02d6-7405-95e2f1046fd9" name="Page-1">7V1bj6O4Ev41kfo8dAtjIMljJ3M96jlqbe/ZyyMJToKG4AhIX/bXHxtswBeCk3bSGR1Wo51gCoNdVV99VTbMCM63r1+zcLf5gSOUjFwneh3BTyPXdZ2xQ/6iLW9VCwBwWrWssziq2pym4Sn+BzFB3rqPI5SztqqpwDgp4p3YuMRpipaF0BZmGX4RxVY4iYSGXbhGSsPTMkzU1j/jqNhUrRN33LR/Q/F6w+8MAja+Rbj8uc7wPmX3G7lwVf5Xnd6GvC820HwTRvil1QQ/j+A8w7iofm1f5yihkytO25eOs/VzZygtTC5wqwuew2TPhv4jjFP2bMUbn4/8Jd4mYUqOZiucFk/sDCDHYRKvU/J7Se6IMtLwjLIiJlN5z04UeEdal5s4iR7CN7ynz5UXZJ740WyDs/gf0m2YsD7J6axgVuEGgsQTvZI0O6Q1QzmReeSDBVLTj/BVEHwI84I1LHGShLs8XtTD2IbZOk5nuCjwlgnxQX+Jk2SOE5yVc8H1CWfqXLPppzOAXltNbO6/IrxFRfZGRNhZP2B2wBxlwg5fGqNzPda2aRmcz/QWMjtf1z03uiY/mLr1qoeK6kcuGZNDDeDmX+THCN7T85hcINsDGV5R6inDPxGfmxRXBtKaLtbEbSRBq6LTQvJduIzT9UMp88lrWn5j46ZNmFy7SkqP2cRRhFKqXVyERVipkupth+O0KCfGn5E/ZPrmzp0/8smDz8kxaI7JHyqeFXOckrGQgdP7IGInL4jaikbFrrGKmUqJ/RqplMu9R6WBotL73S4hU13EeHDqSzk1dEWndh1DrwbQeb8NjBUbuKWBMsyivPbpfz+SGSAXE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WjEzUREr+jdkXIceeOgcB8AJh2sJuGDd05rsSIJl7dcBIpmmqgyD8aiqaQ7/3kmZQVK4FT6ZMb0xNJke/3dGQJmODEF+7juR8ATGpmecXAFFwbMAFRg9yS7apI3bTS/krLFaAURxzi2w5wRchxxp2Q06Bb4PotdHM6kM0IovjW9DZGTY+GqLHHy2QcohwrBlN/IpQbzKkY5U57OurAqHPBiLpJ54phZPJhMGJateG1RQ030RbbP9LrnTvPb/s8RQFnfDTPEEjF5HhS4Yi1FuBacVifL7hxLgAliDd1WHmDCpS/IGiJVHQ98CVJha+uiF8vGnBXuyJSIWrwLKSC59rXVippQGUMoIwqEHahCqcSJfZMhDoLDf/v4ROanIdX/I8pv8CpdxYG4Z9c+p32dGSr/DIVgdmHk8sD0q9UfuGuebWAdCutaNpRkb4as74WtlPnKmMwFtegJrCvEuOMhJRoGky6cMwIkqCuInx8jgMd/m6V5RwHiMAylpmOMUKNezqyhlCu9j4XRahfqQ7jX10dxhU1CM5CmdQc9/NrQYAnNwQoPqmBgFeSIhugkUsiRtjAdwi1scE1LdG29iPUn7N4Lxg4El+pd68diwYASGXZQP7nVjrg4ARV88Ef3jTR/gbite+dqBcDal4MvCPD1tjrpN9Gpqlj0samaRcvfGhpqSDoW3O4bBku+JX2KHAnu+IyHP+8bsfHUa/KvQVaSrzVtZH1XtgvxxJ1nPgn+qXyvjmneGeIFb9SsYsb9DX7nG5/cvNpqyvwudYCu1ijIjlV4B8dI4XK0rEbe+z43TSwVFQC8ssK56oqTTuqV10PJstP4YG19lNQQM3fnLs7DmfXiAQfl8N1IAE5bP7h3EoFzT9PDD//Dw==</diagram></mxfile>
1 change: 1 addition & 0 deletions ClassDiagramNoGUI.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0" version="9.1.8" editor="www.draw.io" type="github"><diagram id="3775ebc4-31d6-02d6-7405-95e2f1046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xDDCsh9q+lPCpnO2QPMNllO8yio+29KsnmtvvaqjPk9sglzlVsQWZw3+X1pq9MlUNQ4FCU+vDYlMK9dZU5sGjb7BpQLHefI1tTad61/EZA3/22wL/xK4ZiuUfAeUuKP/Uyr39Hw==</diagram></mxfile>
126 changes: 41 additions & 85 deletions Dealer.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
import java.util.concurrent.ThreadLocalRandom;

/**
* Write a description of class Dealer here.
*
* @author (your name)
* @version (a version number or a date)
* Dealer extends from Player and also creates the playing card deck
*
* @author Lucas
*/
public class Dealer
public class Dealer extends Player
{
private Card[] hand = new Card[10];
private int handCards = 0;

private boolean finished = false;
private boolean busted = false;

private Card[] cards = new Card[208];
private int cardsNumber = 208;
private int cardsNumber;

/**
* Sets chips and bet to -1 because the dealer has endless chips and won´t place a bet
*/
public Dealer()
{
super(null);

chips = -1;
bet = -1;
dealer = this;
}

/**
* Dealer draws on 16 stands on all 17
*/
public void turn()
{
int handValue = getHandValue();

if (handValue < 17)
{
hit();
if (handValue < 17)
if (handValue > 17)
{
stand();
}
Expand All @@ -40,59 +43,48 @@ public void turn()
}
}

public void deal()
/**
* Dealer draws only one card
*/
public int deal()
{
hit();
hit();
return 0;
}

public void hit()
{
hand[handCards] = getCard();
handCards++;

if (getHandValue() > 21)
{
for (int i = 0; i < handCards; i++)
{
if (hand[i].getNumber() == 11)
{
hand[i].setLower();
if (getHandValue() < 21)
{
break;
}
}
}
}
if (getHandValue() >= 21)
{
if (getHandValue() > 21)
{
busted = true;
}
stand();
}
}

public void stand()
/**
* Overwritten to set bet to -1, so the dealer doesn´t have to place a bet
*/
@Override
public void flushHand()
{
finished = true;
super.flushHand();
bet = -1;
}

/**
* Returns a card from the stack
*/
public Card getCard()
{
if (cardsNumber == 0)
{
createCards();
}
cardsNumber--;
return cards[cardsNumber];
}

/**
* Creates 4 decks á 52 cards
*/
public void createCards()
{
// Blackjack is played with 4 Decks
for (int i = 0; i < 4; i++) {
// Create the 4 Suites
for (int j = 0; j < 4; j++) {
// Create The 13 Ranks
// Create the 13 Ranks
for (int k = 0; k < 13; k++) {
cards[i*52 + j*13 + k*1] = new Card(j+1, k+1);
}
Expand All @@ -106,43 +98,7 @@ public void createCards()
cards[i] = cards[rndm];
cards[rndm] = tmp;
}
}

public void flushHand()
{
hand = new Card[10];
handCards = 0;
finished = false;
busted = false;
}

public Card[] getHand()
{
return hand;
}

public int getHandValue()
{
int value = 0;
for (int i = 0; i < handCards; i++)
{
value += hand[i].getNumber();
}
return value;
}

public int getFirstCardValue()
{
return hand[0].getNumber();
}

public boolean getFinished()
{
return finished;
}

public boolean getBusted()
{
return busted;

cardsNumber = 208;
}
}
Loading