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

Workflow file to change version #811

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b961f15
working on an abstract GridRegion class (WIP)
Kevin-771 Jan 30, 2024
d84ad72
added comments to GridRegion
Kevin-771 Feb 2, 2024
e52e03b
Merge branch 'master' into gridRegion
Kevin-771 Feb 2, 2024
70e9f91
Merge branch 'dev' into gridRegion
Kevin-771 Feb 2, 2024
79d3608
modified GridRegion to handle generic types
Kevin-771 Feb 2, 2024
d8dea70
Merge branch 'gridRegion' of https://github.com/Bram-Hub/LEGUP into g…
Kevin-771 Feb 2, 2024
2ae7017
Update GridRegion.java
Kevin-771 Feb 2, 2024
b5b73ba
Added board initialization template
Chase-Grajeda Feb 2, 2024
6b066ae
RippleEffect importer
Chase-Grajeda Feb 9, 2024
a0c7dcf
Merge pull request #776 from Bram-Hub/dev
Chase-Grajeda Apr 2, 2024
a33eb7c
Created file for version change, currently testing in private reposit…
pitbull51067 Apr 5, 2024
7e0aace
This is the final code, I just have to change the path on Tuesday bec…
pitbull51067 Apr 15, 2024
0a3ed2e
Let's see if it works
pitbull51067 Apr 16, 2024
c9b92af
Trying to get the file right.
pitbull51067 Apr 16, 2024
ed15760
Trying to ignore the.gitignore flag.
pitbull51067 Apr 16, 2024
dea0ac6
let's try now that we have more permission
pitbull51067 Apr 16, 2024
9a9acfe
We gave GitHub actions permission to write.
pitbull51067 Apr 16, 2024
2e51bb5
Increment version number
pitbull51067 Apr 16, 2024
f0f1476
This is for the final version before I make my pull request. Changed …
pitbull51067 Apr 16, 2024
86d296e
Merge branch 'Regions' of https://github.com/pitbull51067/Legup into …
pitbull51067 Apr 16, 2024
88bcf1d
Final commit after updating branch.
pitbull51067 Apr 16, 2024
75f4ce8
Merge branch 'dev' into Regions
charlestian23 May 5, 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
52 changes: 52 additions & 0 deletions .github/workflows/version-changer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Increment Version on Push

on:
push:
branches:
- master

jobs:
increment_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Determine new version
id: update_version
run: |
current_version=$(<legup-update/bin/main/edu.rpi.legupupdate/VERSION)
IFS='.' read -r -a version_parts <<< "$current_version"
first_part="${version_parts[0]}"
second_part="${version_parts[1]}"
last_part="${version_parts[2]}"

if [[ $last_part -eq 9 ]]; then
new_last_part=0
if [[ $second_part -eq 9 ]]; then
new_second_part=0
new_first_part=$((first_part + 1))
else
new_second_part=$((second_part + 1))
new_first_part=$first_part
fi
else
new_last_part=$((last_part + 1))
new_second_part=$second_part
new_first_part=$first_part
fi

new_version="$new_first_part.$new_second_part.$new_last_part"
echo "New version: $new_version"
echo "::set-output name=version::$new_version"

- name: Update version.txt with new version
run: echo "${{ steps.update_version.outputs.version }}" > legup-update/bin/main/edu.rpi.legupupdate/VERSION

- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "Pitbull51067"
git add -f legup-update/bin/main/edu.rpi.legupupdate/VERSION
git commit -m "Increment version number"
git push
2 changes: 1 addition & 1 deletion legup-update/bin/main/edu.rpi.legupupdate/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
6.0.1
99 changes: 99 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package edu.rpi.legup.puzzle.rippleeffect;

import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.RegisterPuzzle;
import edu.rpi.legup.model.gameboard.Board;
import edu.rpi.legup.model.gameboard.PuzzleElement;
import edu.rpi.legup.model.rules.ContradictionRule;


/**
* 1) Number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number.
* 2) Each Room contains consecutive numbers starting from 1.
* 3) If a number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number.
*/



@RegisterPuzzle
public class RippleEffect extends Puzzle {

public RippleEffect() {
super();
this.name = "RippleEffect";

this.importer = new RippleEffectImporter(this);
// this.exporter = new LightUpExporter(this);

// this.factory = new LightUpCellFactory();
}

/**
* Initializes the game board. Called by the invoker of the class
*/
@Override
public void initializeView() {
// boardView = new LightUpView((LightUpBoard) currentBoard);
// boardView.setBoard(currentBoard);
// addBoardListener(boardView);
}

/**
* Generates a random edu.rpi.legup.puzzle based on the difficulty
*
* @param difficulty level of difficulty (1-10)
* @return board of the random edu.rpi.legup.puzzle
*/
@Override
public Board generatePuzzle(int difficulty) {
return null;
}

@Override
/**
* Determines if the given dimensions are valid for Light Up
*
* @param rows the number of rows
* @param columns the number of columns
* @return true if the given dimensions are valid for Light Up, false otherwise
*/
public boolean isValidDimensions(int rows, int columns) {
return rows > 0 && columns > 0;
}

/**
* Determines if the current board is a valid state
*
* @param board board to check for validity
* @return true if board is valid, false otherwise
*/
@Override
public boolean isBoardComplete(Board board) {
// LightUpBoard lightUpBoard = (LightUpBoard) board;
// lightUpBoard.fillWithLight();

// for (ContradictionRule rule : contradictionRules) {
// if (rule.checkContradiction(lightUpBoard) == null) {
// System.out.println(rule.getRuleName());
// return false;
// }
// }
// for (PuzzleElement data : lightUpBoard.getPuzzleElements()) {
// LightUpCell cell = (LightUpCell) data;
// if ((cell.getType() == LightUpCellType.UNKNOWN || cell.getType() == LightUpCellType.EMPTY) && !cell.isLite()) {
// return false;
// }
// }
return true;
}

/**
* Callback for when the board puzzleElement changes
*
* @param board the board that has changed
*/
@Override
public void onBoardChange(Board board) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package edu.rpi.legup.puzzle.rippleeffect;

import edu.rpi.legup.model.gameboard.GridBoard;

public class RippleEffectBoard extends GridBoard {
public RippleEffectBoard(int width, int height) {
super(width, height);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package edu.rpi.legup.puzzle.rippleeffect;

import edu.rpi.legup.model.gameboard.GridCell;
import java.awt.Point;

public class RippleEffectCell extends GridCell<RippleEffectCellType> {
public RippleEffectCell(RippleEffectCellType type, Point location) {
super(type, location);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package edu.rpi.legup.puzzle.rippleeffect;

public enum RippleEffectCellType {
EMPTY(0), FILLED(1);
public int value;

RippleEffectCellType(int value) {
this.value = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package edu.rpi.legup.puzzle.rippleeffect;

import edu.rpi.legup.model.PuzzleImporter;
import edu.rpi.legup.save.InvalidFileFormatException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.awt.Point;

public class RippleEffectImporter extends PuzzleImporter {
public RippleEffectImporter(RippleEffect rippleEffect) {
super(rippleEffect);
}

/**
* Puzzle setting to support row and column inputs
*/
@Override
public boolean acceptsRowsAndColumnsInput() {
return true;
}

/**
* Puzzle setting to disable support for text input
*/
@Override
public boolean acceptsTextInput() {
return false;
}


/**
* Constructs empty RippleEffect gameboard as per the provided dimensions
* @param rows number of rows for the gameboard
* @param columns number of columns for the gameboard
*/
@Override
public void initializeBoard(int rows, int columns) {
RippleEffectBoard rippleEffectBoard = new RippleEffectBoard(rows, columns);
for (int y = 0; y < rows; y++) {
for (int x = 0; x < columns; x++) {
// new ripple effect cell
if (rippleEffectBoard.getCell(x, y) == null) {
RippleEffectCell cell = new RippleEffectCell(RippleEffectCellType.EMPTY, new Point(x, y));
cell.setIndex(y * columns + x);
cell.setModifiable(true);
rippleEffectBoard.setCell(x, y, cell);
}
}
}
puzzle.setCurrentBoard(rippleEffectBoard);
}



/**
* Constructs RippleEffect gameboard
* @param node xml document node
* @throws InvalidFileFormatException if file is invalid
*/
@Override
public void initializeBoard(Node node) throws InvalidFileFormatException {
if (node == null) throw new InvalidFileFormatException("Invalid format");
}



/**
* Initialize board via string of statements.
* @throws UnsupportedOperationException since RippleEffect does not support text input
*/
@Override
public void initializeBoard(String[] statements) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Ripple Effect does not accept text input");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package edu.rpi.legup.puzzle.rippleeffect;

public class RippleEffectView {

}
Loading