-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from ryankirkpatrick97/master
F17_lab05
- Loading branch information
Showing
126 changed files
with
2,007 additions
and
1,575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# Package Files # | ||
*.war | ||
*.ear | ||
*.jar | ||
|
||
# Temp Files # | ||
*~ | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Ryan Kirkpatrick and Ryan Lorica | ||
|
||
### List of things that can be done (no particular order): | ||
|
||
* Make this todo list once complete into issues. | ||
* Add manifest for jar compilation | ||
* Separate each of the guis. There are ones for the rules, the welcome, player | ||
names, initial bets, and the actual game | ||
* Idea for possibly setting players or similar objects as observers to a main | ||
subject class that would control the flow of the game from player to player. | ||
* Do composition for a lot of the gui elements like menubar | ||
* Music stops looping after a while | ||
* Current player should be displayed at the bottom without any notice of the | ||
other players. After one player finishes, another should rotate to the front, | ||
and start their turn. Also, we need to implement it in such a way that the player | ||
class can affect these positions. | ||
* Closing the naming players Gui doesn't stop the program from running. This can | ||
be seen, because the music continues to play. | ||
* Clean up the case statements of that are caused by number of players. These look very redundant, and they should be able to be refactored. There is also a block in the NameGui that can also be fixed. | ||
* Make renaming with the menubar work properly. | ||
* Create a main controller or something of sort to hold consistent variables, such as numPlayers, playerNames, and amountBet. | ||
* The way players and player positions are handled needs an overhaul of refactoring. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package edu.ucsb.cs56.projects.game.blackjack; | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class BetGui implements Gui{ | ||
JPanel outerPanel; | ||
|
||
JFrame betFrame; | ||
JPanel betPanel; | ||
JLabel betTitleLabel; | ||
|
||
JLabel betAmountLabel; | ||
int amountBet; | ||
|
||
JTextField betText; | ||
JButton betButton; | ||
|
||
JButton betAmount1; | ||
JButton betAmount2; | ||
JButton betAmount3; | ||
JButton betAmount4; | ||
JButton betAmount5; | ||
|
||
|
||
/** creates window for betting | ||
*/ | ||
public void display() { | ||
|
||
// create the frame and panels, as well as set the layout | ||
betFrame = new JFrame(); | ||
betPanel = new JPanel(new GridLayout(7,0,5,0)); | ||
betTitleLabel = new JLabel(); | ||
|
||
// set the main text and center it | ||
betTitleLabel.setText("<html>How much would you<br>like to bet?</html>"); | ||
betTitleLabel.setHorizontalAlignment(JLabel.CENTER); | ||
|
||
// by default have the $25 bet selected | ||
betAmountLabel = new JLabel("$25"); | ||
betAmountLabel.setHorizontalAlignment(JLabel.CENTER); // center the label | ||
amountBet = 25; | ||
|
||
betText = new JTextField("Or enter your desired bet amount here"); | ||
|
||
// create bet amount buttons and assign ActionListeners | ||
betAmount1 = new JButton("$25"); | ||
betAmount2 = new JButton("$50"); | ||
betAmount3 = new JButton("$100"); | ||
betAmount4 = new JButton("$250"); | ||
betAmount5 = new JButton("$500"); | ||
|
||
// create button to confirm selected bet amount | ||
betButton = new JButton("Confirm Bet"); | ||
//betButton.addActionListener(new BeginGameListener()); | ||
// add widgets to panel | ||
betPanel.add(betTitleLabel); | ||
betPanel.add(betAmountLabel); | ||
betPanel.add(betAmount1); | ||
betPanel.add(betAmount2); | ||
betPanel.add(betAmount3); | ||
betPanel.add(betAmount4); | ||
betPanel.add(betAmount5); | ||
betPanel.add(betText); | ||
betPanel.add(betButton); | ||
betText.selectAll(); | ||
|
||
// create the outer panel to center the widgets | ||
outerPanel = new JPanel(); | ||
outerPanel.setLayout(new BoxLayout(outerPanel, BoxLayout.PAGE_AXIS)); | ||
outerPanel.add(Box.createHorizontalGlue()); | ||
outerPanel.add(betPanel); | ||
outerPanel.add(Box.createHorizontalGlue()); | ||
// add the panel to the frame and set frame attributes | ||
betFrame.add(outerPanel); | ||
/* | ||
// Since this is the only frame before the game starts, if this window | ||
// is closed the application should terminate | ||
betFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
// If the betting frame is brought up at the end of a round and closed using the 'x' button the game | ||
// should not be terminated. | ||
if(!exit_on_close) | ||
*/ | ||
betFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); | ||
|
||
betFrame.pack(); | ||
betFrame.setLocationRelativeTo(null); // center window | ||
betFrame.setVisible(true); | ||
} | ||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.