Implement active/inactive note system.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
e30a0cc1ed
commit
ae3a07e9cd
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"java.configuration.updateBuildConfiguration": "automatic"
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
|||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.7</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -58,6 +58,9 @@ public class LLSIG implements KeyListener{
|
|||||||
for (int i=0;i<9;i++) {
|
for (int i=0;i<9;i++) {
|
||||||
if (lanePress[i]) {
|
if (lanePress[i]) {
|
||||||
lanePress[i]=false;
|
lanePress[i]=false;
|
||||||
|
if (lanes.get(i).noteExists()) {
|
||||||
|
lanes.get(i).getNote()
|
||||||
|
}
|
||||||
//TODO Hit detection goes here.
|
//TODO Hit detection goes here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,17 +12,30 @@ public class Lane{
|
|||||||
public boolean endOfChart() {
|
public boolean endOfChart() {
|
||||||
return currentNoteIndex==noteChart.size()-1;
|
return currentNoteIndex==noteChart.size()-1;
|
||||||
}
|
}
|
||||||
|
public void clearOutInactiveNotes() {
|
||||||
|
noteChart.removeIf(note->!note.active);
|
||||||
|
}
|
||||||
public boolean noteExists() {
|
public boolean noteExists() {
|
||||||
return noteExists(0);
|
return getNote()!=null;
|
||||||
}
|
}
|
||||||
public boolean noteExists(int noteOffset) {
|
public boolean noteExists(int noteOffset) {
|
||||||
return currentNoteIndex+noteOffset<noteChart.size();
|
return getNote(noteOffset)!=null;
|
||||||
}
|
}
|
||||||
public Note getNote(int noteOffset) throws IndexOutOfBoundsException {
|
public Note getNote(int noteOffset) throws IndexOutOfBoundsException {
|
||||||
return noteChart.get(currentNoteIndex+noteOffset);
|
for (int i=noteOffset;i<noteChart.size();i++)
|
||||||
|
{
|
||||||
|
Note n = getNote(i);
|
||||||
|
if (n.active) {return n;}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
public Note getNote() {
|
public Note getNote() {
|
||||||
return getNote(0);
|
for (int i=0;i<noteChart.size();i++)
|
||||||
|
{
|
||||||
|
Note n = getNote(i);
|
||||||
|
if (n.active) {return n;}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
public void addNote(Note n) {
|
public void addNote(Note n) {
|
||||||
addNote(n,false);
|
addNote(n,false);
|
||||||
|
@ -3,6 +3,7 @@ package main.java.LLSIG;
|
|||||||
public class Note {
|
public class Note {
|
||||||
NoteType type;
|
NoteType type;
|
||||||
int start,end;
|
int start,end;
|
||||||
|
boolean active=true; //Set to false when the note has been scored.
|
||||||
public Note(NoteType type,int start,int end) {
|
public Note(NoteType type,int start,int end) {
|
||||||
this.type=type;
|
this.type=type;
|
||||||
this.start=start;
|
this.start=start;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user