Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
2b751de
Add files via upload
DDMMMAA Nov 4, 2024
9a006f0
Update specification of blue print to README.md
DDMMMAA Nov 4, 2024
f178b9c
Update partial UserStories to README.md
DDMMMAA Nov 4, 2024
8676e06
Update Team members on README.md
DDMMMAA Nov 4, 2024
e7e56d5
formating TeamMembers section of README.md
DDMMMAA Nov 4, 2024
c162887
Update Yann and John's user story on README.md
DDMMMAA Nov 4, 2024
c1a9e44
delete instruction from course repo on README.md
DDMMMAA Nov 4, 2024
219c164
Delete project blueprint draft i guess.docx
DDMMMAA Nov 4, 2024
491462e
Yann's Github username added.
YannChi22 Nov 4, 2024
9491a5a
Add group user story to README.md
DDMMMAA Nov 4, 2024
dc069ff
Yann's Github username added.
YannChi22 Nov 11, 2024
079873a
add 'rankPointHistory' instance variable, 'getter', and 'addRankPoint…
DDMMMAA Nov 11, 2024
f8f1c57
Merge pull request #1 from DDMMMAA/yann.chi
DDMMMAA Nov 11, 2024
f9d5f02
add new method 'getCurrentRankPoint' that return the last element of …
DDMMMAA Nov 11, 2024
4ca7884
Entities with minimal functions
J0hnDing Nov 11, 2024
6289d3e
'ShowProfile' use case in Package 'src/main/java/use_case/showProfile…
Nov 15, 2024
2d776a8
Fixed move class and chesspiece class as noted
J0hnDing Nov 18, 2024
3a98325
Merge pull request #3 from DDMMMAA/john.ding
DDMMMAA Nov 18, 2024
eb78a4f
partial implimentation of 'showprofile' interface_adapter and 'profil…
DDMMMAA Nov 18, 2024
4ee05d3
Merge pull request #2 from DDMMMAA/jiaqi.ma
J0hnDing Nov 18, 2024
dbcf211
Small checkstyle edits to Board and Move.
207moment Nov 21, 2024
b5917ec
all new file added in this commit comtain only minimal template (no l…
Nov 21, 2024
b4f299b
Merge pull request #4 from DDMMMAA/jiaqi.ma
J0hnDing Nov 21, 2024
92b8fcc
Yann's user story updated.
YannChi22 Nov 21, 2024
19f30b3
Merge pull request #6 from DDMMMAA/michelle.bakman
DDMMMAA Nov 22, 2024
f5a4051
Yann's user story updated.
YannChi22 Nov 22, 2024
a7ae26d
Merge pull request #7 from DDMMMAA/yann.chi
DDMMMAA Nov 22, 2024
3b54cad
Implemented Input Data, Input Boundary,Controller. Changed the type o…
J0hnDing Nov 22, 2024
2f0393e
Delete src/main/java/use_case/move/Move.java
DDMMMAA Nov 22, 2024
ccba202
Merge pull request #9 from DDMMMAA/john.ding
DDMMMAA Nov 22, 2024
093aa92
empty 'DailyPuzzleDataAccessInterface.java' added
Nov 22, 2024
d03887c
Merge pull request #10 from DDMMMAA/jiaqi.ma
J0hnDing Nov 22, 2024
651332a
change MoveDataAccessInterface and MoveOutPutBoundary from class to i…
Nov 22, 2024
411bdbf
LoginInputData
unomaru Nov 22, 2024
a0e43d4
LoginInputBoundary, LoginInteractor, LoginOutputBoundary, LoginOutput…
unomaru Nov 22, 2024
8187e6e
SignupInputBoundary, SignupInputData, SignupInteractor, SignupOutputB…
unomaru Nov 22, 2024
79434fa
UserFactory deletion
unomaru Nov 22, 2024
3f08528
SignupInteractor Updated
unomaru Nov 22, 2024
fb10baf
Login Interface
unomaru Nov 22, 2024
66bbedf
LoggedIn Interface
unomaru Nov 22, 2024
875ee6c
'DailPuzzleDataAccessInterface.java' & 'ChessDataAccessObject.java' &…
Nov 24, 2024
54b3296
Merge pull request #11 from DDMMMAA/jiaqi.ma
J0hnDing Nov 25, 2024
da5a37f
'ChessBoardView.java''s 'actionPerformed' method implemented. It can …
DDMMMAA Nov 25, 2024
502f57d
Implementation of API access methods and interfaces, also cleanup of …
207moment Nov 25, 2024
f98c078
'ChessBoardView.java' CheckStyle clean up
DDMMMAA Nov 25, 2024
766144a
Merge pull request #14 from DDMMMAA/michelle.bakman
DDMMMAA Nov 25, 2024
24f3d6a
UserDataAccessObject Added
unomaru Nov 25, 2024
f5855be
ChessDataAccessObject -deleted UserDAO part
unomaru Nov 25, 2024
56578f7
Merge branch 'main' into c.kashiwabara
unomaru Nov 25, 2024
07b9c5c
Merge pull request #12 from DDMMMAA/c.kashiwabara
DDMMMAA Nov 25, 2024
1c55444
Views added for Signup, Login
unomaru Nov 25, 2024
9b84b61
Signup and Login App
unomaru Nov 26, 2024
755cfa9
Merge pull request #13 from DDMMMAA/jiaqi.ma
unomaru Nov 27, 2024
7a13af3
Making the Signup, Login view work together with Chess Game
unomaru Nov 27, 2024
6e89a73
Merge pull request #15 from DDMMMAA/c.kashiwabara
DDMMMAA Nov 27, 2024
c275bd5
'ChessBoardView.java' can now highlight 'Valid' grid of 'MoveViewMode…
Nov 27, 2024
9640312
'ChessBoardView.java' can now highlight 'Valid' grid of 'MoveViewMode…
Nov 27, 2024
6873ad2
Merge remote-tracking branch 'origin/jiaqi.ma' into jiaqi.ma
Nov 27, 2024
b012a2e
'showProfile' button added into 'LoggedInView.java' for 'showProfile'…
Nov 28, 2024
dfdba75
1. Change the data type of position from Arraylist to int[].
J0hnDing Nov 28, 2024
ac747c5
1. Change the data type of position from Arraylist to int[].
J0hnDing Nov 28, 2024
55a1f9e
refactor creation of LoggedInView into 'ShowProfileUseCaseFactory.jav…
Nov 28, 2024
a810c0d
Merge pull request #16 from DDMMMAA/jiaqi.ma
unomaru Nov 28, 2024
794e4ec
Refactor LoginUseCaseFactory, SignupUseCaseFactory
unomaru Nov 28, 2024
7475e08
Merge pull request #17 from DDMMMAA/john.ding
DDMMMAA Nov 29, 2024
4fe9cc8
README.md update
Nov 29, 2024
13ef21d
README.md update
Nov 29, 2024
4818aef
README.md update
Nov 29, 2024
1be1ace
Merge pull request #18 from DDMMMAA/jiaqi.ma
DDMMMAA Nov 29, 2024
5c3da49
important!!!: new 'Board' and 'Game' is created in addMoveUseCase met…
Nov 29, 2024
09e0fd6
Merge pull request #19 from DDMMMAA/jiaqi.ma
DDMMMAA Nov 29, 2024
20c8111
LoggedInView minor change
unomaru Nov 29, 2024
b4939f1
Merge branch 'main' into c.kashiwabara
unomaru Nov 29, 2024
4d93b79
Minor adjustment to Yann's user story.
YannChi22 Nov 30, 2024
1fb16a3
README.me update
Nov 30, 2024
b4c5f9d
Added Query use case and added button of show rank history in view.
YannChi22 Nov 30, 2024
0750870
LoggedInView minor change
unomaru Nov 30, 2024
bfc91a6
Merge pull request #22 from DDMMMAA/jiaqi.ma
unomaru Nov 30, 2024
005e095
README edit
unomaru Nov 30, 2024
d5c4afb
Attempt to create switchToSignUpPage
unomaru Dec 1, 2024
e793da7
Added ;
unomaru Dec 1, 2024
38cf194
Merge pull request #20 from DDMMMAA/c.kashiwabara
DDMMMAA Dec 1, 2024
08f205c
README.md update
Dec 1, 2024
b5bdb1f
Update Query view in interface adapter and create Query DAO file.
YannChi22 Dec 1, 2024
4009401
Added use case output data.
YannChi22 Dec 1, 2024
256c9c3
Added use case output data.
YannChi22 Dec 1, 2024
d9f74da
Update pom file and added RankHistory Entity.
YannChi22 Dec 2, 2024
c2d0abc
Update use cases and query view.
YannChi22 Dec 2, 2024
ce84ec0
Update main_ck with query view.
YannChi22 Dec 2, 2024
9f2197a
Update LoggedInView.java and ShowProfileUseCaseFactory.java with quer…
YannChi22 Dec 2, 2024
b59f128
Fixing bugs.
YannChi22 Dec 2, 2024
6357394
Back button added in Profile view without real actionlistener
Dec 2, 2024
cd6e646
All 'Note' related package reserved from course repo deleted, deleted…
Dec 2, 2024
ba757d3
Daily puzzle view model starter code
207moment Dec 2, 2024
904fa95
delete 'note' test, modified 'ChessBoardViewTest' by create new 'test…
Dec 2, 2024
61d7eec
Move now work, get valid moves in the interacter has not been impleme…
J0hnDing Dec 2, 2024
7f7baea
Addition of blank knight and king classes.
207moment Dec 2, 2024
809946d
Merge branch 'main' into yann.chi
YannChi22 Dec 2, 2024
e944ad6
README.md update
Dec 1, 2024
7d68f51
Merge pull request #26 from DDMMMAA/john.ding
DDMMMAA Dec 2, 2024
ab67556
Merge branch 'main' into michelle.bakman
207moment Dec 2, 2024
8787965
Merge pull request #27 from DDMMMAA/michelle.bakman
J0hnDing Dec 2, 2024
b3963e2
accessibility report added
Dec 2, 2024
82eec2d
Back button added in Profile view without real actionlistener
Dec 2, 2024
7262da8
All 'Note' related package reserved from course repo deleted, deleted…
Dec 2, 2024
ea1f25d
delete 'note' test, modified 'ChessBoardViewTest' by create new 'test…
Dec 2, 2024
706394f
accessibility report added
Dec 2, 2024
0b7dea5
Merge remote-tracking branch 'origin/jiaqi.ma' into jiaqi.ma
Dec 2, 2024
7bd8607
README update
Dec 2, 2024
a68e61f
remove highlighted grid when game just start, README link update
Dec 3, 2024
190b661
Merge pull request #23 from DDMMMAA/jiaqi.ma
unomaru Dec 3, 2024
7b22b76
Delete cancel button
unomaru Dec 3, 2024
aae5772
Delete unused line
unomaru Dec 3, 2024
76b913b
checkstyle
unomaru Dec 3, 2024
8b6b4b8
Create the functionality of cancel button at Login page
unomaru Dec 3, 2024
2460f70
Valid moves and turn based game has been implemented.
J0hnDing Dec 3, 2024
04817da
Merge pull request #28 from DDMMMAA/c.kashiwabara
DDMMMAA Dec 3, 2024
b7743cd
small fix on turns
J0hnDing Dec 3, 2024
d9e43f6
Merge pull request #29 from DDMMMAA/john.ding
207moment Dec 3, 2024
7190d8d
Login and Signup Test
unomaru Dec 3, 2024
4ea633c
MainChessAPP to MainChessApp (Checkstyle)
unomaru Dec 3, 2024
c543096
Checkstyles
unomaru Dec 3, 2024
0fa6d3c
Readme update for daily puzzle
207moment Dec 3, 2024
7d53a34
Created UserAppBuilder and moved codes from MainChessApp to UserAppBu…
unomaru Dec 3, 2024
87ab11a
CheckStyle
unomaru Dec 3, 2024
7a916ca
Merge branch 'main' into c.kashiwabara
unomaru Dec 3, 2024
c957523
Merge pull request #31 from DDMMMAA/michelle.bakman
DDMMMAA Dec 3, 2024
6e29a8c
Minor adjustment to Yann's user story.
YannChi22 Nov 30, 2024
d16d21b
Added Query use case and added button of show rank history in view.
YannChi22 Nov 30, 2024
54c220e
Update Query view in interface adapter and create Query DAO file.
YannChi22 Dec 1, 2024
bc626a0
Added use case output data.
YannChi22 Dec 1, 2024
7089c43
Added use case output data.
YannChi22 Dec 1, 2024
fea62de
Update pom file and added RankHistory Entity.
YannChi22 Dec 2, 2024
5e84327
Update use cases and query view.
YannChi22 Dec 2, 2024
beadcd1
Update main_ck with query view.
YannChi22 Dec 2, 2024
58b188e
Update LoggedInView.java and ShowProfileUseCaseFactory.java with quer…
YannChi22 Dec 2, 2024
c773a61
Fixing bugs.
YannChi22 Dec 2, 2024
d61e92d
.
YannChi22 Dec 3, 2024
997bdb0
.
YannChi22 Dec 3, 2024
b7e2082
Merge remote-tracking branch 'origin/yann.chi' into yann.chi
YannChi22 Dec 3, 2024
015d9f0
Rebase origin main.
YannChi22 Dec 3, 2024
c7acae7
Add RankHistory entity.
YannChi22 Dec 3, 2024
d9d8837
Add Query DAO.
YannChi22 Dec 3, 2024
9b287f7
Add Query use case package.
YannChi22 Dec 3, 2024
e686d2b
Add Query interface_adapter package.
YannChi22 Dec 3, 2024
b8153d6
Add Query view.
YannChi22 Dec 3, 2024
8d3aa2d
Merge pull request #30 from DDMMMAA/c.kashiwabara
DDMMMAA Dec 3, 2024
3d70dbc
Add Query view in main class.
YannChi22 Dec 3, 2024
e4f7491
Update ShowProfileUseCaseFactory with query LoggedInView.
YannChi22 Dec 3, 2024
37b5fa7
Update LoggedInView to add JButton of showRankHistory.
YannChi22 Dec 3, 2024
b7e17bc
Fix MainChessApp LoggedInView parameters queryViewModel and queryDAO.
YannChi22 Dec 3, 2024
57b858c
README.md update
J0hnDing Dec 3, 2024
e5a9e73
add show profile gif for README.md
DDMMMAA Dec 3, 2024
4efcdef
Merge pull request #33 from DDMMMAA/john.ding
DDMMMAA Dec 3, 2024
0388a0f
Merge pull request #34 from DDMMMAA/jiaqi.ma
207moment Dec 3, 2024
0524890
README.md update
DDMMMAA Dec 3, 2024
a334990
README.md update
DDMMMAA Dec 3, 2024
395d004
Merge pull request #35 from DDMMMAA/jiaqi.ma
207moment Dec 3, 2024
dd6b13e
README.md update2
J0hnDing Dec 3, 2024
c02d52b
Merge pull request #36 from DDMMMAA/john.ding
DDMMMAA Dec 3, 2024
5b4c0b4
Update Query.
YannChi22 Dec 3, 2024
654798f
Update Query.
YannChi22 Dec 3, 2024
9d0e581
Merge branch 'main' into yann.chi
YannChi22 Dec 3, 2024
03b1d18
Delete src/Main.java
YannChi22 Dec 3, 2024
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
124 changes: 98 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,108 @@
# Note Application
# Chess Puzzles

This is a minimal example demonstrating usage of the
password-protected user part of the API used in lab 5.
## Team Members

You can find more information about the API endpoints in
[the documentation](https://www.postman.com/cloudy-astronaut-813156/csc207-grade-apis-demo/documentation/fg3zkjm/5-password-protected-user).
Chihana Kashiwabara - unomaru

If your team is considering an application for which it would be convenient to
store data in something like a database, you may find that the API calls demonstrated
here will be useful in your project, as this will allow you to store
an arbitrary JSON object associated with a username and password.
Jiaqi Ma - DDMMMAA

In this application, a single note has a name (the "username" in terms of the API) and the note
can be read by anyone who knows the name — but only edited by someone who
knows the password for it.
Michelle Bakman - 207moment

You can see the documentation in the various files for more information.
John Ding - J0hnDing

## Testing
Yann Chi - YannChi22

The repo also includes an example of a use case interactor test, as well as
an example of an end-to-end test which automates button clicks and inspects
the contents of the actual views. This is something we discussed in the lectures
about testing in CA but had not provided a code example of before. Note, one
could also inspect the contents of the ViewModel objects instead when testing
CA to make a similar test which would be less dependent on the details of the
specific UI implementation.
## Table of content

## Project Starter Code
+ [About This Project](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#about-this-project)
+ [Installation](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#installation)
+ [Use Case (Feature)](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#use-cases-features)
+ [Signup & Login](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#signup--login)
+ [Show Profile](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#show-profile)
+ [Generate Daily Puzzle](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#generate-daily-puzzle)
+ [Step by Step Move](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#generate-daily-puzzle)
+ [Usage Guide](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#usage-guide)
+ [Feedback](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#feedback)
+ [Contribute to this project](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#this-project-is-close-for-contributions)
+ [User Stories](https://github.com/DDMMMAA/CSC207-Team179?tab=readme-ov-file#user-stories)

Your team may choose to use this repo as starter code for your project. You could
also use the lab 5 code — or start from an empty repo if your team prefers.

If you choose to use one of the repositories we have provided, you can either make
a fork of it or copy the subset of code you want into a completely new repository.
## About this project

This app/project is able to generate random chess puzzles with options for daily, random puzzles, or specifically themed puzzles.
A user will be able to view their puzzle statistics or review past puzzles within the current session of the program.
Users should have the option to log in or create an account [built into the lichess api].
If a user is logged in, they should be able to access any past puzzle scores or game histories they’ve played on that account.

## Installation

To Start: Clone ```main``` branch into your favorite JAVA IDE, then run ```MainChessAPP.java``` in ```src/main/java/app```
```
git clone https://github.com/DDMMMAA/CSC207-Team179.git
```

To close: Left click ```X``` icon at top right.

Note: No additional package needed

## Use Cases (Features)




### <ins>Signup & Login</ins>

This feature allows users to signup by creating username and password and login to the account created.

To Signup: Enter username and password(two times) to be used for an account, and click ```Signup``` to confirm signup.

To Login: Click ```Login``` to navigate to a login page, enter username and password for the account, and click ```Login``` to confirm login.


### <ins>Show Profile</ins>

User can view their profile (Contain User name and rank point currently) after login by click ```Show Profile``` after login.

Note: New user's rank point is set to ```0```

![Show Profile](https://github.com/DDMMMAA/CSC207-Team179/blob/main/Show%20Profilegif.gif?raw=true)


### <ins>Generate daily puzzle</ins>

This requests the algebraic chess notation for the current daily puzzle in the Lichess API
and stores the set of solutions and the series of moves to create the puzzle board.

### <ins>Step by step move</ins>

This feature enables users to move a chess piece to a valid position during their turn.
Since moving a piece involves two steps, select and move, this usecase have two functionality.

To Select: User clicks on the square containing the chess piece they want to select. The program then highlights all valid moves in yellow.

To Move: If one piece is selected and the user clicks on one of the highlighted squares, the chess piece is moved to the target position.

Note: Clicking an invalid move after select deselects the piece.

## Usage Guide

This meant to me used in order of ```Signup & Login``` &rarr; ```Generate daily puzzle``` &rarr; ```Step by step move```
(Please refer to above ```use cases (Features)``` for detail of each use case)

## Feedback

Plead use github [Discussion board](https://github.com/DDMMMAA/CSC207-Team179/discussions) to submit your feedback.

Simply start a new discussion with appropriate title (eg., associated use case).

## This project is close for contributions

## User Stories

Group User Story. Tom generate a chess puzzle, solve it step by step, and eventually win.

1. John wants to play a chess puzzle. He opens the chess puzzle player and clicks generate puzzle of the day. The chess puzzle of the day loads on screen. [Michelle’s Story]
2. Tom and Tim argued about who is a better chess player, so they decided to compare their Rank point of Ranking system. [Jiaqi Ma’s Story]
3. As Mary hears about this chess puzzle, she wants to create an account and log in to start a puzzle. [Chihana’s Story]
4. Andy is learning chess, and he can use this program to check his learning progress, by looking at past statistics of chess puzzles. He can search up his user account using the username. [Yann Chi's Story]
5. Felix wants to see the possible moves he can make with one piece, so he click on that piece and the possible cells will be indicated. [John’s Story]
Binary file added Show Profilegif.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions accessibility-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Principle of Universal desgin

+ Equitable Use
+ Users are allowed to input any String as their username, not restricted to english. User with none english name can benefit from this.
+ Flexibility in Use
+ Features could add: Allowed user to pick board theme (ie., Black/white, light theme, dark theme).
+ Simple and Intuitive Use
+ Move use are match with intuition. Click a piece to select, slick a grid to move
+ Perceptible Information
+ This program can't accommodate user with visual disability currently. A potential feature might add to accommodate visual disability is allowed user to select other output device (ie., touch board)
+ Tolerance of Error
+ Tolerating wrong click on grid that doesn't contain piece. Error message like "Can't select empty grid" doesn't sent, because click on empty grid is common that sent error message everytime wrong click happened will be annoyed.
+ Low Physical Effort
+ The only interaction use need while play the chess game is clicking mose.
+ Size and Space for Approach and Use
+ Size of the window (chess board) is adjustable.

## Program Market
+ If I were to market my chess puzzle program, I would target chess enthusiasts and learners of all ages, particularly those seeking to improve their strategic thinking and problem-solving skills. The program would appeal to students and educators looking for engaging tools to teach or practice chess fundamentals, as well as casual players who enjoy the intellectual challenge of solving puzzles in their leisure time. Additionally, the program could attract competitive chess players aiming to refine their tactics through a curated collection of puzzles ranging from beginner to advanced levels.

## People who can't take advantage of this App
+ People with dysgnosia is less likely to take advantage of this App, simply because this App is meant to be intellectually challenging. However, puzzle difficulty classification feature can be added and might accommodate people with dysgnosia.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.tors42</groupId>
<artifactId>chariot</artifactId>
<version>0.1.10</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.79</version>
</dependency>

</dependencies>

Expand Down
67 changes: 67 additions & 0 deletions src/main/java/app/ChessAppBuilder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package app;

import data_access.ChessDataAccessObject;
import entity.Board;
import entity.Game;
import interface_adapter.ViewManagerModel;
import interface_adapter.move.MoveController;
import interface_adapter.move.MovePresenter;
import interface_adapter.move.MoveViewModel;
import use_case.move.MoveInteractor;
import use_case.move.MoveOutputBoundary;
import view.ChessBoardView;

/**
* Builder for the Chess Application.
*/
public class ChessAppBuilder {
public static final int HEIGHT = 800;
public static final int WIDTH = 800;
// TODO change to ChessDataAccessInterface once implemented
private ChessDataAccessObject chessDataAccessObject;
private MoveViewModel moveViewModel = new MoveViewModel();
private final ViewManagerModel viewManagerModel = new ViewManagerModel();
private ChessBoardView chessBoardView;
private MoveInteractor moveInteractor;

/**
* Set the ChessDAO to be used in this application.
* @param chessDataAccess the DAO to use
* @return this builder
*/
public ChessAppBuilder addChessDAO(ChessDataAccessObject chessDataAccess) {
chessDataAccessObject = chessDataAccess;
return this;
}

/**
* Creates the objects for the Move Use Case and connects the ChessBoardView to Move controller.
* @return this builder
*/
public ChessAppBuilder addMoveUseCase() {
final MoveOutputBoundary moveOutPutBoundary = new MovePresenter(moveViewModel, viewManagerModel);
Board board = new Board();
Game game = new Game(board, true);
moveInteractor = new MoveInteractor(
chessDataAccessObject, moveOutPutBoundary, game);

final MoveController moveController = new MoveController(moveInteractor);
chessBoardView.setMoveController(moveController);
return this;
}

/**
* Creates the ChessBoardView and underlying MoveViewModel.
* @return this builder
*/
public ChessAppBuilder addMoveView() {
moveViewModel = new MoveViewModel();
final MoveController moveController = new MoveController(moveInteractor);
chessBoardView = new ChessBoardView(moveViewModel, moveController);
return this;
}

public ChessBoardView buildChessBoardView() {
return chessBoardView;
}
}
61 changes: 61 additions & 0 deletions src/main/java/app/LoginUseCaseFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package app;

import interface_adapter.ViewManagerModel;
import interface_adapter.logged_in.LoggedInViewModel;
import interface_adapter.login.LoginController;
import interface_adapter.login.LoginPresenter;
import interface_adapter.login.LoginViewModel;
import interface_adapter.signup.SignupViewModel;
import use_case.login.LoginInputBoundary;
import use_case.login.LoginInteractor;
import use_case.login.LoginOutputBoundary;
import use_case.login.LoginUserDataAccessInterface;
import view.LoginView;

/**
* This class contains the static factory function for creating the LoginView.
*/
public final class LoginUseCaseFactory {

/** Prevent instantiation. */
private LoginUseCaseFactory() {

}

/**
* Factory function for creating the LoginView.
* @param viewManagerModel the ViewManagerModel to inject into the LoginView
* @param loginViewModel the LoginViewModel to inject into the LoginView
* @param loggedInViewModel the LoggedInViewModel to inject into the LoginView
* @param userDataAccessObject the LoginUserDataAccessInterface to inject into the LoginView
* @param signupViewModel the SignupViewModel to inject into the LoginView
* @return the LoginView created for the provided input classes
*/
public static LoginView create(
ViewManagerModel viewManagerModel,
LoginViewModel loginViewModel,
LoggedInViewModel loggedInViewModel,
LoginUserDataAccessInterface userDataAccessObject,
SignupViewModel signupViewModel) {

final LoginController loginController = createLoginUseCase(viewManagerModel, loginViewModel,
loggedInViewModel, userDataAccessObject, signupViewModel);
return new LoginView(loginViewModel, loginController);

}

private static LoginController createLoginUseCase(
ViewManagerModel viewManagerModel,
LoginViewModel loginViewModel,
LoggedInViewModel loggedInViewModel,
LoginUserDataAccessInterface userDataAccessObject,
SignupViewModel signupViewModel) {

final LoginOutputBoundary loginOutputBoundary = new LoginPresenter(viewManagerModel,
loggedInViewModel, loginViewModel, signupViewModel);
final LoginInputBoundary loginInteractor = new LoginInteractor(
userDataAccessObject, loginOutputBoundary);

return new LoginController(loginInteractor);
}
}
21 changes: 21 additions & 0 deletions src/main/java/app/MainChessApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package app;

/**
* Main that activates login page.
*/
public class MainChessApp {

/**
* The main method for starting the program with an external database used to persist user data.
* @param args input to main
*/
public static void main(String[] args) {

final UserAppBuilder userAppBuilder = new UserAppBuilder();
userAppBuilder.addViewModels()
.addViews()
.initializeState()
.addChessGame()
.build();
}
}
56 changes: 0 additions & 56 deletions src/main/java/app/MainNoteApplication.java

This file was deleted.

Loading