moving stuff around again

This commit is contained in:
yugecin 2017-01-10 12:07:24 +01:00
parent 0ceff03bdd
commit e05b675285
11 changed files with 26 additions and 27 deletions

View File

@ -21,10 +21,10 @@ import com.google.inject.Inject;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.kernel.InstanceContainer; import yugecin.opsudance.kernel.InstanceContainer;
import yugecin.opsudance.states.EmptyState; import yugecin.opsudance.states.EmptyState;
import yugecin.opsudance.states.GameState; import yugecin.opsudance.core.state.OpsuState;
import yugecin.opsudance.states.transitions.FadeInTransitionState; import yugecin.opsudance.core.state.transitions.FadeInTransitionState;
import yugecin.opsudance.states.transitions.FadeOutTransitionState; import yugecin.opsudance.core.state.transitions.FadeOutTransitionState;
import yugecin.opsudance.states.transitions.TransitionState; import yugecin.opsudance.core.state.transitions.TransitionState;
/** /**
* state demultiplexer, sends events to current state * state demultiplexer, sends events to current state
@ -36,7 +36,7 @@ public class Demux {
private TransitionState fadeOutTransitionState; private TransitionState fadeOutTransitionState;
private TransitionState fadeInTransitionState; private TransitionState fadeInTransitionState;
private GameState state; private OpsuState state;
@Inject @Inject
public Demux(InstanceContainer instanceContainer) { public Demux(InstanceContainer instanceContainer) {
@ -66,7 +66,7 @@ public class Demux {
return state == fadeInTransitionState || state == fadeOutTransitionState; return state == fadeInTransitionState || state == fadeOutTransitionState;
} }
public void switchState(GameState newState) { public void switchState(OpsuState newState) {
if (isTransitioning()) { if (isTransitioning()) {
return; return;
} }
@ -76,7 +76,7 @@ public class Demux {
state.enter(); state.enter();
} }
public void switchStateNow(GameState newState) { public void switchStateNow(OpsuState newState) {
if (!isTransitioning()) { if (!isTransitioning()) {
return; return;
} }

View File

@ -143,8 +143,6 @@ public class DisplayContainer {
if (displayMode.getBitsPerPixel() == 16) { if (displayMode.getBitsPerPixel() == 16) {
InternalTextureLoader.get().set16BitMode(); InternalTextureLoader.get().set16BitMode();
} }
getDelta();
} }
private void initGL() { private void initGL() {

View File

@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>. * along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/ */
package yugecin.opsudance.states; package yugecin.opsudance.core.state;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
public interface GameState { public interface OpsuState {
void update(int delta); void update(int delta);
void render(Graphics g); void render(Graphics g);

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>. * along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/ */
package yugecin.opsudance.states.transitions; package yugecin.opsudance.core.state.transitions;
import com.google.inject.Inject; import com.google.inject.Inject;
import yugecin.opsudance.core.Demux; import yugecin.opsudance.core.Demux;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>. * along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/ */
package yugecin.opsudance.states.transitions; package yugecin.opsudance.core.state.transitions;
import com.google.inject.Inject; import com.google.inject.Inject;
import yugecin.opsudance.core.Demux; import yugecin.opsudance.core.Demux;

View File

@ -15,16 +15,16 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>. * along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/ */
package yugecin.opsudance.states.transitions; package yugecin.opsudance.core.state.transitions;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.core.DisplayContainer; import yugecin.opsudance.core.DisplayContainer;
import yugecin.opsudance.states.GameState; import yugecin.opsudance.core.state.OpsuState;
public abstract class FadeTransitionState extends TransitionState { public abstract class FadeTransitionState extends TransitionState {
protected GameState applicableState; protected OpsuState applicableState;
private final DisplayContainer container; private final DisplayContainer container;
@ -40,7 +40,7 @@ public abstract class FadeTransitionState extends TransitionState {
black = new Color(Color.black); black = new Color(Color.black);
} }
public void setApplicableState(GameState applicableState) { public void setApplicableState(OpsuState applicableState) {
this.applicableState = applicableState; this.applicableState = applicableState;
} }

View File

@ -15,14 +15,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>. * along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/ */
package yugecin.opsudance.states.transitions; package yugecin.opsudance.core.state.transitions;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.states.GameState; import yugecin.opsudance.core.state.OpsuState;
public abstract class TransitionState implements GameState { public abstract class TransitionState implements OpsuState {
protected GameState applicableState; protected OpsuState applicableState;
protected final int transitionTargetTime; protected final int transitionTargetTime;
protected int transitionTime; protected int transitionTime;
@ -31,7 +31,7 @@ public abstract class TransitionState implements GameState {
this.transitionTargetTime = transitionTargetTime; this.transitionTargetTime = transitionTargetTime;
} }
public void setApplicableState(GameState applicableState) { public void setApplicableState(OpsuState applicableState) {
this.applicableState = applicableState; this.applicableState = applicableState;
} }

View File

@ -22,7 +22,6 @@ import yugecin.opsudance.OpsuDance;
public class Entrypoint { public class Entrypoint {
public static final long startTime = System.currentTimeMillis(); public static final long startTime = System.currentTimeMillis();
public static final boolean isJarRunning = Entrypoint.class.getResource(String.format("%s.class", Entrypoint.class.getSimpleName())).toString().startsWith("jar:");
public static void main(String[] args) { public static void main(String[] args) {
log("launched"); log("launched");

View File

@ -23,8 +23,8 @@ import yugecin.opsudance.core.DisplayContainer;
import yugecin.opsudance.core.Demux; import yugecin.opsudance.core.Demux;
import yugecin.opsudance.states.EmptyRedState; import yugecin.opsudance.states.EmptyRedState;
import yugecin.opsudance.states.EmptyState; import yugecin.opsudance.states.EmptyState;
import yugecin.opsudance.states.transitions.FadeInTransitionState; import yugecin.opsudance.core.state.transitions.FadeInTransitionState;
import yugecin.opsudance.states.transitions.FadeOutTransitionState; import yugecin.opsudance.core.state.transitions.FadeOutTransitionState;
public class OpsuDanceModule extends AbstractModule { public class OpsuDanceModule extends AbstractModule {

View File

@ -21,9 +21,10 @@ import com.google.inject.Inject;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.core.Demux; import yugecin.opsudance.core.Demux;
import yugecin.opsudance.core.state.OpsuState;
import yugecin.opsudance.kernel.InstanceContainer; import yugecin.opsudance.kernel.InstanceContainer;
public class EmptyRedState implements GameState { public class EmptyRedState implements OpsuState {
private int counter; private int counter;

View File

@ -21,9 +21,10 @@ import com.google.inject.Inject;
import org.newdawn.slick.Color; import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics; import org.newdawn.slick.Graphics;
import yugecin.opsudance.core.Demux; import yugecin.opsudance.core.Demux;
import yugecin.opsudance.core.state.OpsuState;
import yugecin.opsudance.kernel.InstanceContainer; import yugecin.opsudance.kernel.InstanceContainer;
public class EmptyState implements GameState { public class EmptyState implements OpsuState {
private int counter; private int counter;