Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nguyen Nguyen
babaisus
Commits
8db9debb
Commit
8db9debb
authored
May 18, 2021
by
ces050
Browse files
Created JUNIT testing skeleton, Scanned Project for bad Javadocs.
parent
320e10e6
Changes
12
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
8db9debb
...
@@ -20,10 +20,10 @@ test {
...
@@ -20,10 +20,10 @@ test {
// Needs to be either 11.0.2 or 14.0.2
// Needs to be either 11.0.2 or 14.0.2
javafx
{
javafx
{
version
=
"14.0.2"
version
=
"14.0.2"
modules
=
[
'javafx.controls'
,
'javafx.fxml'
,
'javafx.media'
]
modules
=
[
'javafx.controls'
,
'javafx.fxml'
,
'javafx.media'
]
}
}
dependencies
{
dependencies
{
testI
mplementation
(
'org.junit.jupiter:junit-jupiter:5.6.2'
)
i
mplementation
'org.junit.jupiter:junit-jupiter:5.6.2'
}
}
application
{
application
{
mainClassName
=
project
.
hasProperty
(
"mainClass"
)
?
project
.
getProperty
(
"mainClass"
)
:
mainClassName
=
project
.
hasProperty
(
"mainClass"
)
?
project
.
getProperty
(
"mainClass"
)
:
...
...
src/main/java/gameManager/GameManager.java
View file @
8db9debb
...
@@ -2,16 +2,14 @@ package gameManager;
...
@@ -2,16 +2,14 @@ package gameManager;
import
javafx.application.Application
;
import
javafx.application.Application
;
import
javafx.scene.Scene
;
import
javafx.scene.Scene
;
import
javafx.scene.media.Media
;
import
javafx.scene.media.MediaPlayer
;
import
javafx.scene.media.MediaPlayer
;
import
javafx.scene.media.MediaView
;
import
javafx.stage.Stage
;
import
javafx.stage.Stage
;
import
javafx.util.Duration
;
import
mediaPlayer.MusicPlayer
;
import
mediaPlayer.MusicPlayer
;
import
java.io.File
;
/**
import
java.nio.file.Paths
;
* Master application for the entire game itself, running this class begins the game and
* loads the user in the way the game is intended to be played.
*/
public
class
GameManager
extends
Application
{
public
class
GameManager
extends
Application
{
public
static
final
int
GAME_WIDTH
=
800
;
public
static
final
int
GAME_WIDTH
=
800
;
public
static
final
int
GAME_HEIGHT
=
600
;
public
static
final
int
GAME_HEIGHT
=
600
;
...
@@ -24,7 +22,7 @@ public class GameManager extends Application {
...
@@ -24,7 +22,7 @@ public class GameManager extends Application {
public
static
String
styleSheet
;
public
static
String
styleSheet
;
public
MediaPlayer
player
;
public
MediaPlayer
player
;
//manages the game sounds
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
launch
(
args
);
launch
(
args
);
...
@@ -52,6 +50,9 @@ public class GameManager extends Application {
...
@@ -52,6 +50,9 @@ public class GameManager extends Application {
playMusic
();
playMusic
();
}
}
/**
* Manages the MusicPlayer of the game to load the soundtrack into it
*/
private
void
playMusic
(){
private
void
playMusic
(){
// get media
// get media
MusicPlayer
.
getMedia
(
"/src/main/Resources/music/BabaIsUsMusic.mp3"
);
MusicPlayer
.
getMedia
(
"/src/main/Resources/music/BabaIsUsMusic.mp3"
);
...
...
src/main/java/gameMenu/GameMenuController.java
View file @
8db9debb
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Package: gameMenu
* Package: gameMenu
* Class: GameMenuController
* Class: GameMenuController
*
*
* Description:
THIS IS A DESCRIPTION Y’ALL AND I NEED TO CHANGE THIS!
* Description:
Controller for the GameMenu
*
*
* ****************************************
* ****************************************
*/
*/
...
...
src/main/java/gameMenu/GameMenuMain.java
View file @
8db9debb
...
@@ -5,6 +5,9 @@ import javafx.scene.Parent;
...
@@ -5,6 +5,9 @@ import javafx.scene.Parent;
import
javafx.scene.Scene
;
import
javafx.scene.Scene
;
import
javafx.stage.Stage
;
import
javafx.stage.Stage
;
/**
* Main Application to run the GameMenu, loads in a GameMenuView to load the visuals
*/
public
class
GameMenuMain
extends
Application
{
public
class
GameMenuMain
extends
Application
{
// view for the menu
// view for the menu
...
...
src/main/java/gameMenu/GameMenuView.java
View file @
8db9debb
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Package: gameMenu
* Package: gameMenu
* Class: GameMenuView
* Class: GameMenuView
*
*
* Description:
THIS IS A DESCRIPTION Y’ALL AND I NEED TO CHANGE THIS!
* Description:
Class storing most of the visual information for the GameMenu
*
*
* ****************************************
* ****************************************
*/
*/
...
@@ -31,6 +31,9 @@ import java.io.File;
...
@@ -31,6 +31,9 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
/**
* Used to add visuals to the game menu in GameMenuMain
*/
public
class
GameMenuView
{
public
class
GameMenuView
{
private
VBox
root
;
private
VBox
root
;
...
@@ -41,6 +44,11 @@ public class GameMenuView {
...
@@ -41,6 +44,11 @@ public class GameMenuView {
private
Label
instructions
,
settings
,
exit
;
private
Label
instructions
,
settings
,
exit
;
/**
* Configures the main menu visually by loading the required pictures, and generating
* buttons or labels.
*/
public
GameMenuView
(){
public
GameMenuView
(){
// vertical root, set to min height + width, with id for background styling
// vertical root, set to min height + width, with id for background styling
root
=
new
VBox
();
root
=
new
VBox
();
...
...
src/main/java/gameboard/BabaIsYouGameGUIController.java
View file @
8db9debb
...
@@ -12,7 +12,7 @@ package gameboard;/* *****************************************
...
@@ -12,7 +12,7 @@ package gameboard;/* *****************************************
* Package: PACKAGE_NAME
* Package: PACKAGE_NAME
* Class: gameboard.BabaIsYouGameGUIController
* Class: gameboard.BabaIsYouGameGUIController
*
*
* Description:
THIS IS A DESCRIPTION Y’ALL AND I NEED TO CHANGE THIS!
* Description:
Master Controller of the Game GUI
*
*
* ****************************************
* ****************************************
*/
*/
...
@@ -65,7 +65,11 @@ public class BabaIsYouGameGUIController {
...
@@ -65,7 +65,11 @@ public class BabaIsYouGameGUIController {
private
BabaIsYouGameGUIView
theView
;
private
BabaIsYouGameGUIView
theView
;
/**
*
* @param theView
* @param theModel
*/
public
BabaIsYouGameGUIController
(
BabaIsYouGameGUIView
theView
,
BabaIsYouGameGUIModel
theModel
){
public
BabaIsYouGameGUIController
(
BabaIsYouGameGUIView
theView
,
BabaIsYouGameGUIModel
theModel
){
this
.
theModel
=
new
BabaIsYouGameGUIModel
();
this
.
theModel
=
new
BabaIsYouGameGUIModel
();
this
.
theView
=
new
BabaIsYouGameGUIView
(
theModel
);
this
.
theView
=
new
BabaIsYouGameGUIView
(
theModel
);
...
...
src/main/java/gameboard/BabaIsYouGameGUIModel.java
View file @
8db9debb
...
@@ -12,7 +12,7 @@ package gameboard;/* *****************************************
...
@@ -12,7 +12,7 @@ package gameboard;/* *****************************************
* Package: PACKAGE_NAME
* Package: PACKAGE_NAME
* Class: gameboard.BabaIsYouGameGUIModel
* Class: gameboard.BabaIsYouGameGUIModel
*
*
* Description:
THIS IS A DESCRIPTION Y’ALL AND I NEED TO CHANGE THIS!
* Description:
GUI GAME MODEL FOR PLAN B OF GAME
*
*
* ****************************************
* ****************************************
*/
*/
...
...
src/main/java/gameboard/BabaIsYouGameGUIView.java
View file @
8db9debb
...
@@ -52,6 +52,11 @@ public class BabaIsYouGameGUIView {
...
@@ -52,6 +52,11 @@ public class BabaIsYouGameGUIView {
protected
static
Scene
scene
;
protected
static
Scene
scene
;
private
BabaIsYouGameGUIModel
theModel
;
private
BabaIsYouGameGUIModel
theModel
;
/**
* Loads up the Game GUI into the given model
* @param theModel BabaIsYouGameGUIModel object to be manipulated.
*/
public
BabaIsYouGameGUIView
(
BabaIsYouGameGUIModel
theModel
){
public
BabaIsYouGameGUIView
(
BabaIsYouGameGUIModel
theModel
){
this
.
theModel
=
new
BabaIsYouGameGUIModel
();
this
.
theModel
=
new
BabaIsYouGameGUIModel
();
//Setting up the screen...
//Setting up the screen...
...
...
src/main/java/gameboard/ExitScene.java
View file @
8db9debb
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Package: gameboard
* Package: gameboard
* Class: ExitScene
* Class: ExitScene
*
*
* Description:
THIS IS A DESCRIPTION Y’ALL AND I NEED TO CHANGE THIS!
* Description:
Once th game is won, this code outputs a victory screen.
*
*
* ****************************************
* ****************************************
*/
*/
...
@@ -24,6 +24,9 @@ import javafx.scene.Scene;
...
@@ -24,6 +24,9 @@ import javafx.scene.Scene;
import
javafx.scene.control.Label
;
import
javafx.scene.control.Label
;
import
javafx.scene.layout.VBox
;
import
javafx.scene.layout.VBox
;
/**
* Used to display the game won message once the game is completed.
*/
public
class
ExitScene
{
public
class
ExitScene
{
/** The width of the board */
/** The width of the board */
private
static
final
int
WIDTH
=
800
;
private
static
final
int
WIDTH
=
800
;
...
...
src/main/java/gameboard/InGameMenu.java
View file @
8db9debb
...
@@ -46,7 +46,8 @@ public class InGameMenu {
...
@@ -46,7 +46,8 @@ public class InGameMenu {
private
static
BabaIsYouGameGUIController
theController
;
private
static
BabaIsYouGameGUIController
theController
;
/**
/**
* Generate the in-game menu after we pressed ESC while playing
* Generate the in-game menu after ESC is pressed while playing. Loads up a
* menu with options for the game, hints, a way to restart, and exit the game.
*/
*/
public
static
void
generateInGameMenu
()
{
public
static
void
generateInGameMenu
()
{
VBox
layout
=
new
VBox
();
VBox
layout
=
new
VBox
();
...
...
src/test/java/TestController.java
0 → 100644
View file @
8db9debb
/* *****************************************
* CSCI205 - Software Engineering and Design
* Spring 2021
* Instructor: Prof. Chris Dancy
*
* Name: Christiaan Smith
* Section: 1:50pm - 2:40pm
* Date: 5/18/2021
* Time: 1:51 AM
*
* Project: CSCI205SP21finalproject
* Package: PACKAGE_NAME
* Class: TestController
*
* Description: COLLECTION OF JUNIT TESTS TO TEST THE CONTROLLER
*
* ****************************************
*/
public
class
TestController
{
}
src/test/java/TestModel.java
0 → 100644
View file @
8db9debb
/* *****************************************
* CSCI205 - Software Engineering and Design
* Spring 2021
* Instructor: Prof. Chris Dancy
*
* Name: Christiaan Smith
* Section: 1:50pm - 2:40pm
* Date: 5/18/2021
* Time: 1:52 AM
*
* Project: CSCI205SP21finalproject
* Package: PACKAGE_NAME
* Class: TestModel
*
* Description: COLLECTION OF JUNIT TESTS TO TEST THE MODEL
*
* ****************************************
*/
public
class
TestModel
{
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment