Updated pom.xml

This commit is contained in:
Andrea Cavalli 2018-10-14 22:32:08 +02:00
parent 5e1d1dde52
commit 971759a6e7
18 changed files with 502 additions and 512 deletions

2
Flow

@ -1 +1 @@
Subproject commit 4ec16b0e2d49da9771503e713604f5641ef6c414 Subproject commit 9acbcc2e0af4961688490eb3447d990d157a46a8

View File

@ -6,10 +6,9 @@
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-core</artifactId> <artifactId>warppi-core</artifactId>
<packaging>bundle</packaging>
<name>WarpPI Calculator Core</name> <name>WarpPI Calculator Core</name>
<description>WarpPI Calculator core project</description> <description>WarpPI Calculator core project</description>
@ -46,16 +45,8 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*</Import-Package>
<Export-Package>it.cavallium.warppi.*</Export-Package>
<Bundle-SymbolicName>warppi-core</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -1,11 +1,11 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public enum BlockColor { public enum BlockColor {
RED, RED,
GREEN, GREEN,
BLUE, BLUE,
YELLOW, YELLOW,
ORANGE, ORANGE,
PURPLE, PURPLE,
CYAN CYAN
} }

View File

@ -1,126 +1,126 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public abstract class Tetromino { public abstract class Tetromino {
private byte x, y, rotation; private byte x, y, rotation;
private final TetrominoType type; private final TetrominoType type;
public final boolean o = false, w = true; public final boolean o = false, w = true;
public Tetromino(byte x, byte y, byte rotation, TetrominoType type) { public Tetromino(byte x, byte y, byte rotation, TetrominoType type) {
super(); super();
this.x = x; this.x = x;
this.y = y; this.y = y;
this.rotation = rotation; this.rotation = rotation;
this.type = type; this.type = type;
} }
public byte getX() { public byte getX() {
return x; return x;
} }
public void setX(byte x) { public void setX(byte x) {
this.x = x; this.x = x;
} }
public byte getY() { public byte getY() {
return y; return y;
} }
public void setY(byte y) { public void setY(byte y) {
this.y = y; this.y = y;
} }
public byte getRotation() { public byte getRotation() {
return rotation; return rotation;
} }
public void setRotation(byte rotation) { public void setRotation(byte rotation) {
this.rotation = rotation; this.rotation = rotation;
} }
public TetrominoType getType() { public TetrominoType getType() {
return type; return type;
} }
public BlockColor getColor() { public BlockColor getColor() {
switch(type) { switch(type) {
case I_CYAN: case I_CYAN:
return BlockColor.CYAN; return BlockColor.CYAN;
case J_BLUE: case J_BLUE:
return BlockColor.BLUE; return BlockColor.BLUE;
case L_ORANGE: case L_ORANGE:
return BlockColor.ORANGE; return BlockColor.ORANGE;
case O_YELLOW: case O_YELLOW:
return BlockColor.YELLOW; return BlockColor.YELLOW;
case S_GREEN: case S_GREEN:
return BlockColor.GREEN; return BlockColor.GREEN;
case T_PURPLE: case T_PURPLE:
return BlockColor.PURPLE; return BlockColor.PURPLE;
case Z_RED: case Z_RED:
return BlockColor.RED; return BlockColor.RED;
default: default:
return BlockColor.RED; return BlockColor.RED;
} }
} }
public void draw(BlockColor[] grid, final int WIDTH) { public void draw(BlockColor[] grid, final int WIDTH) {
boolean[] blockGrid = getRenderedBlock(); boolean[] blockGrid = getRenderedBlock();
final int tetrominoGridSize = getTetrominoGridSize(); final int tetrominoGridSize = getTetrominoGridSize();
final int centerOffset = (int) Math.floor((double)tetrominoGridSize/2d); final int centerOffset = (int) Math.floor((double)tetrominoGridSize/2d);
final BlockColor type = getColor(); final BlockColor type = getColor();
for (int bx = 0; bx < tetrominoGridSize; bx++) { for (int bx = 0; bx < tetrominoGridSize; bx++) {
for (int by = 0; by < tetrominoGridSize; by++) { for (int by = 0; by < tetrominoGridSize; by++) {
if (blockGrid[bx+by*tetrominoGridSize] == w) { if (blockGrid[bx+by*tetrominoGridSize] == w) {
final int index = x+bx-centerOffset + (y+by-centerOffset) * WIDTH; final int index = x+bx-centerOffset + (y+by-centerOffset) * WIDTH;
if (index < grid.length && index >= 0) { if (index < grid.length && index >= 0) {
grid[index] = type; grid[index] = type;
} }
} }
} }
} }
} }
public void fixInitialPosition() { public void fixInitialPosition() {
this.y -= (byte) (this.getTetrominoGridSize()/2); this.y -= (byte) (this.getTetrominoGridSize()/2);
} }
public abstract int getTetrominoGridSize(); public abstract int getTetrominoGridSize();
protected abstract boolean[] getRenderedBlock(); protected abstract boolean[] getRenderedBlock();
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + rotation; result = prime * result + rotation;
result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + x; result = prime * result + x;
result = prime * result + y; result = prime * result + y;
return result; return result;
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)
return true; return true;
if (obj == null) if (obj == null)
return false; return false;
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())
return false; return false;
Tetromino other = (Tetromino) obj; Tetromino other = (Tetromino) obj;
if (rotation != other.rotation) if (rotation != other.rotation)
return false; return false;
if (type != other.type) if (type != other.type)
return false; return false;
if (x != other.x) if (x != other.x)
return false; return false;
if (y != other.y) if (y != other.y)
return false; return false;
return true; return true;
} }
@Override @Override
public String toString() { public String toString() {
return "Tetromino = {\n\t\"x\": \"" + x + "\",\n\ty\": \"" + y + "\",\n\trotation\": \"" + rotation + "\",\n\ttype\": \"" + type + "\"\n}"; return "Tetromino = {\n\t\"x\": \"" + x + "\",\n\ty\": \"" + y + "\",\n\trotation\": \"" + rotation + "\",\n\ttype\": \"" + type + "\"\n}";
} }
} }

View File

@ -1,48 +1,48 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoICyan extends Tetromino { public class TetrominoICyan extends Tetromino {
public TetrominoICyan(byte x, byte y, byte rotation) { public TetrominoICyan(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.I_CYAN); super(x, y, rotation, TetrominoType.I_CYAN);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 4; return 4;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
o,o,o,o, o,o,o,o,
w,w,w,w, w,w,w,w,
o,o,o,o, o,o,o,o,
o,o,o,o o,o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,o,w,o, o,o,w,o,
o,o,w,o, o,o,w,o,
o,o,w,o, o,o,w,o,
o,o,w,o o,o,w,o
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o,o, o,o,o,o,
o,o,o,o, o,o,o,o,
w,w,w,w, w,w,w,w,
o,o,o,o o,o,o,o
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
o,w,o,o, o,w,o,o,
o,w,o,o, o,w,o,o,
o,w,o,o, o,w,o,o,
o,w,o,o o,w,o,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -1,44 +1,44 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoJBlue extends Tetromino { public class TetrominoJBlue extends Tetromino {
public TetrominoJBlue(byte x, byte y, byte rotation) { public TetrominoJBlue(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.J_BLUE); super(x, y, rotation, TetrominoType.J_BLUE);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 3; return 3;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
w,o,o, w,o,o,
w,w,w, w,w,w,
o,o,o o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,w,w, o,w,w,
o,w,o, o,w,o,
o,w,o o,w,o
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o, o,o,o,
w,w,w, w,w,w,
o,o,w o,o,w
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
o,w,o, o,w,o,
w,w,o w,w,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -1,44 +1,44 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoLOrange extends Tetromino { public class TetrominoLOrange extends Tetromino {
public TetrominoLOrange(byte x, byte y, byte rotation) { public TetrominoLOrange(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.L_ORANGE); super(x, y, rotation, TetrominoType.L_ORANGE);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 3; return 3;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
o,o,w, o,o,w,
w,w,w, w,w,w,
o,o,o o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
o,w,o, o,w,o,
o,w,w o,w,w
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o, o,o,o,
w,w,w, w,w,w,
w,o,o w,o,o
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
w,w,o, w,w,o,
o,w,o, o,w,o,
o,w,o o,w,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -1,19 +1,19 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoOYellow extends Tetromino { public class TetrominoOYellow extends Tetromino {
public TetrominoOYellow(byte x, byte y, byte rotation) { public TetrominoOYellow(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.O_YELLOW); super(x, y, rotation, TetrominoType.O_YELLOW);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 2; return 2;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
return new boolean[] { return new boolean[] {
w,w, w,w,
w,w, w,w,
}; };
} }
} }

View File

@ -1,44 +1,44 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoSGreen extends Tetromino { public class TetrominoSGreen extends Tetromino {
public TetrominoSGreen(byte x, byte y, byte rotation) { public TetrominoSGreen(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.S_GREEN); super(x, y, rotation, TetrominoType.S_GREEN);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 3; return 3;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
o,w,w, o,w,w,
w,w,o, w,w,o,
o,o,o o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
o,w,w, o,w,w,
o,o,w o,o,w
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o, o,o,o,
o,w,w, o,w,w,
w,w,o w,w,o
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
w,o,o, w,o,o,
w,w,o, w,w,o,
o,w,o o,w,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -1,44 +1,44 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoTPurple extends Tetromino { public class TetrominoTPurple extends Tetromino {
public TetrominoTPurple(byte x, byte y, byte rotation) { public TetrominoTPurple(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.I_CYAN); super(x, y, rotation, TetrominoType.I_CYAN);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 3; return 3;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
w,w,w, w,w,w,
o,o,o o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
o,w,w, o,w,w,
o,w,o o,w,o
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o, o,o,o,
w,w,w, w,w,w,
o,w,o o,w,o
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
w,w,o, w,w,o,
o,w,o o,w,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -1,11 +1,11 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public enum TetrominoType { public enum TetrominoType {
I_CYAN, I_CYAN,
O_YELLOW, O_YELLOW,
T_PURPLE, T_PURPLE,
S_GREEN, S_GREEN,
Z_RED, Z_RED,
J_BLUE, J_BLUE,
L_ORANGE L_ORANGE
} }

View File

@ -1,44 +1,44 @@
package it.cavallium.warppi.extra.tetris; package it.cavallium.warppi.extra.tetris;
public class TetrominoZRed extends Tetromino { public class TetrominoZRed extends Tetromino {
public TetrominoZRed(byte x, byte y, byte rotation) { public TetrominoZRed(byte x, byte y, byte rotation) {
super(x, y, rotation, TetrominoType.Z_RED); super(x, y, rotation, TetrominoType.Z_RED);
} }
@Override @Override
public int getTetrominoGridSize() { public int getTetrominoGridSize() {
return 3; return 3;
} }
@Override @Override
public boolean[] getRenderedBlock() { public boolean[] getRenderedBlock() {
switch(getRotation()) { switch(getRotation()) {
case 0: case 0:
return new boolean[] { return new boolean[] {
w,w,o, w,w,o,
o,w,w, o,w,w,
o,o,o o,o,o
}; };
case 1: case 1:
return new boolean[] { return new boolean[] {
o,o,w, o,o,w,
o,w,w, o,w,w,
o,w,o o,w,o
}; };
case 2: case 2:
return new boolean[] { return new boolean[] {
o,o,o, o,o,o,
w,w,o, w,w,o,
o,w,w o,w,w
}; };
case 3: case 3:
return new boolean[] { return new boolean[] {
o,w,o, o,w,o,
w,w,o, w,w,o,
w,o,o w,o,o
}; };
default: default:
throw new NullPointerException(); throw new NullPointerException();
} }
} }
} }

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-desktop</artifactId> <artifactId>warppi-desktop</artifactId>

View File

@ -1,58 +1,58 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-engine-jogl</artifactId> <artifactId>warppi-engine-jogl</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WarpPI Calculator JOGL Engine</name> <name>WarpPI Calculator JOGL Engine</name>
<description>WarpPI Calculator engine-jogl project</description> <description>WarpPI Calculator engine-jogl project</description>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi-core</artifactId> <artifactId>warppi-core</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jogamp.jogl</groupId> <groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId> <artifactId>jogl-all-main</artifactId>
<version>2.3.2</version> <version>2.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jogamp.gluegen</groupId> <groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId> <artifactId>gluegen-rt-main</artifactId>
<version>2.3.2</version> <version>2.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ar.com.hjg</groupId> <groupId>ar.com.hjg</groupId>
<artifactId>pngj</artifactId> <artifactId>pngj</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<instructions> <instructions>
<Import-Package>*</Import-Package> <Import-Package>*</Import-Package>
<Export-Package>it.cavallium.warppi.*</Export-Package> <Export-Package>it.cavallium.warppi.*</Export-Package>
<Bundle-SymbolicName>warppi-engine-jogl</Bundle-SymbolicName> <Bundle-SymbolicName>warppi-engine-jogl</Bundle-SymbolicName>
</instructions> </instructions>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-hardware</artifactId> <artifactId>warppi-hardware</artifactId>

View File

@ -5,7 +5,7 @@
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WarpPI Calculator</name> <name>WarpPI Calculator</name>
@ -27,7 +27,6 @@
</scm> </scm>
<properties> <properties>
<project.version>0.9.0a0</project.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-rules</artifactId> <artifactId>warppi-rules</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId> <artifactId>warppi</artifactId>
<version>${project.version}</version> <version>0.9.0a2</version>
</parent> </parent>
<artifactId>warppi-teavm</artifactId> <artifactId>warppi-teavm</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>