got rid of dependency injection, it doesn't add anything at this point and only slows down things and makes a mess. Also some refactoring.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class ApproachCircleSpinner extends Spinner {
|
||||
|
||||
@@ -38,10 +38,10 @@ public class ApproachCircleSpinner extends Spinner {
|
||||
ang += 15;
|
||||
}
|
||||
|
||||
double rad = Options.width / 4.0f * (1d - Spinner.PROGRESS);
|
||||
double rad = displayContainer.width / 4.0f * (1d - Spinner.PROGRESS);
|
||||
|
||||
point[0] = Options.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
||||
point[1] = Options.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class BeamSpinner extends Spinner {
|
||||
|
||||
@@ -26,16 +26,14 @@ public class BeamSpinner extends Spinner {
|
||||
private int index;
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
ang = 0;
|
||||
index = 0;
|
||||
point = new double[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getPoint()
|
||||
{
|
||||
public double[] getPoint() {
|
||||
if (!waitForDelay()) {
|
||||
return point;
|
||||
}
|
||||
@@ -43,26 +41,19 @@ public class BeamSpinner extends Spinner {
|
||||
index = ++index % 4;
|
||||
final int MOD = 60;
|
||||
|
||||
point[0] = Options.width / 2d;
|
||||
point[1] = Options.height / 2d;
|
||||
point[0] = displayContainer.width / 2d;
|
||||
point[1] = displayContainer.height / 2d;
|
||||
|
||||
if( index == 0 )
|
||||
{
|
||||
if( index == 0 ) {
|
||||
add( MOD, 90 );
|
||||
add( MOD, 180 );
|
||||
}
|
||||
else if( index == 1 )
|
||||
{
|
||||
} else if( index == 1 ) {
|
||||
add( MOD, 90 );
|
||||
add( Options.height / 2 * 0.8d, 0 );
|
||||
}
|
||||
else if( index == 2 )
|
||||
{
|
||||
add( displayContainer.height / 2 * 0.8d, 0 );
|
||||
} else if( index == 2 ) {
|
||||
add( MOD, -90 );
|
||||
add( Options.height / 2 * 0.8d, 0 );
|
||||
}
|
||||
else if( index == 3 )
|
||||
{
|
||||
add( displayContainer.height / 2 * 0.8d, 0 );
|
||||
} else if( index == 3 ) {
|
||||
add( MOD, -90 );
|
||||
add( MOD, 180 );
|
||||
ang += 0.3;
|
||||
@@ -71,8 +62,7 @@ public class BeamSpinner extends Spinner {
|
||||
return point;
|
||||
}
|
||||
|
||||
private void add( double rad, double ang )
|
||||
{
|
||||
private void add( double rad, double ang ) {
|
||||
point[0] += rad * Math.cos( (this.ang + ang) / 180d * Math.PI);
|
||||
point[1] -= rad * Math.sin( (this.ang + ang) / 180d * Math.PI);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class CircleSpinner extends Spinner {
|
||||
|
||||
@@ -26,22 +26,20 @@ public class CircleSpinner extends Spinner {
|
||||
private double[] point = new double[2];
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
ang = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getPoint()
|
||||
{
|
||||
public double[] getPoint() {
|
||||
if (waitForDelay()) {
|
||||
ang += 15;
|
||||
}
|
||||
|
||||
double rad = Options.width / 4.0f;
|
||||
double rad = displayContainer.width / 4.0f;
|
||||
|
||||
point[0] = Options.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
||||
point[1] = Options.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
||||
|
||||
public class CubeSpinner extends Spinner {
|
||||
|
||||
@@ -90,10 +90,10 @@ public class CubeSpinner extends Spinner {
|
||||
x *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
||||
y *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
||||
|
||||
double scale = Options.width / (3.0f + 0.5f * Math.cos(size / 180f * Math.PI));
|
||||
double scale = displayContainer.width / (3.0f + 0.5f * Math.cos(size / 180f * Math.PI));
|
||||
//double scale = Options.width / (3.0f + -1f * ((float)(Options.s.ElapsedMilliseconds % Options.beatTimeMs)/(float)Options.beatTimeMs));
|
||||
point[0] = (int) ( Options.width / 2.0f + scale * x );
|
||||
point[1] = (int) ( Options.height / 2.0f - scale * y );
|
||||
point[0] = (int) ( displayContainer.width / 2.0f + scale * x );
|
||||
point[1] = (int) ( displayContainer.height / 2.0f - scale * y );
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class DonutSpinner extends Spinner {
|
||||
|
||||
@@ -38,10 +38,10 @@ public class DonutSpinner extends Spinner {
|
||||
ang += 15;
|
||||
}
|
||||
|
||||
double rad = Options.width / 4.0f;
|
||||
double rad = displayContainer.width / 4.0f;
|
||||
|
||||
point[0] = Options.width / 2.0f + rad * Math.sin(ang);
|
||||
point[1] = Options.height / 2.0f - rad * Math.cos(ang);
|
||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang);
|
||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class FivePointStarApproachSpinner extends Spinner {
|
||||
|
||||
@@ -39,12 +39,12 @@ public class FivePointStarApproachSpinner extends Spinner {
|
||||
odd = !odd;
|
||||
}
|
||||
|
||||
double rad = Options.width / 4.0f * (1d - Spinner.PROGRESS);
|
||||
double rad = displayContainer.width / 4.0f * (1d - Spinner.PROGRESS);
|
||||
if (!odd) {
|
||||
rad /= 3d;
|
||||
}
|
||||
point[0] = Options.width / 2d + Math.cos(ang) * rad;
|
||||
point[1] = Options.height / 2d + Math.sin(ang) * rad;
|
||||
point[0] = displayContainer.width / 2d + Math.cos(ang) * rad;
|
||||
point[1] = displayContainer.height / 2d + Math.sin(ang) * rad;
|
||||
return point;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,18 +17,18 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class FivePointStarSpinner extends Spinner {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
double[][] points = new double[10][];
|
||||
double midx = Options.width / 2d;
|
||||
double midy = Options.height / 2d;
|
||||
double midx = displayContainer.width / 2d;
|
||||
double midy = displayContainer.height / 2d;
|
||||
double angleIncRads = Math.PI * 36d / 180d;
|
||||
double ang = -Math.PI / 2d;
|
||||
double maxrad = Options.width / 4d;
|
||||
double maxrad = displayContainer.width / 4d;
|
||||
double minrad = maxrad / 3d;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
double rad = maxrad;
|
||||
|
||||
@@ -19,6 +19,8 @@ package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
||||
|
||||
public class HalfCircleSpinner extends Spinner {
|
||||
|
||||
private int ang = 0;
|
||||
@@ -45,8 +47,8 @@ public class HalfCircleSpinner extends Spinner {
|
||||
skipang += 359;
|
||||
}
|
||||
|
||||
point[0] = Options.width / 2.0d + Options.height / 2 * 0.8d * Math.cos(ang/180d*Math.PI);
|
||||
point[1] = Options.height / 2.0d + Options.height / 2 * 0.8d * Math.sin(ang/180d*Math.PI);
|
||||
point[0] = displayContainer.width / 2.0d + displayContainer.height / 2 * 0.8d * Math.cos(ang/180d*Math.PI);
|
||||
point[1] = displayContainer.height / 2.0d + displayContainer.height / 2 * 0.8d * Math.sin(ang/180d*Math.PI);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class IlluminatiSpinner extends Spinner {
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
init( new double[][] {
|
||||
new double[] { Options.width / 2d - 120, Options.height / 2d + 80 },
|
||||
new double[] { Options.width / 2d, Options.height / 2d - 160 },
|
||||
new double[] { Options.width / 2d + 120, Options.height / 2d + 80 }
|
||||
new double[] { displayContainer.width / 2d - 120, displayContainer.height / 2d + 80 },
|
||||
new double[] { displayContainer.width / 2d, displayContainer.height / 2d - 160 },
|
||||
new double[] { displayContainer.width / 2d + 120, displayContainer.height / 2d + 80 }
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class LessThanThreeSpinner extends Spinner {
|
||||
|
||||
@@ -38,8 +38,8 @@ public class LessThanThreeSpinner extends Spinner {
|
||||
if( angle > 360 ) angle = 0;
|
||||
double theta = angle / 180d * Math.PI;
|
||||
double[] pos = new double[] {
|
||||
Options.width / 2d,
|
||||
Options.height / 2d
|
||||
displayContainer.width / 2d,
|
||||
displayContainer.height / 2d
|
||||
};
|
||||
|
||||
double r = 2 - 2 * Math.sin( theta ) + Math.sin( theta ) * Math.sqrt( Math.abs( Math.cos( theta ) ) ) / ( Math.sin( theta ) + 1.4 );
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class RektCircleSpinner extends Spinner {
|
||||
|
||||
@@ -25,51 +25,39 @@ public class RektCircleSpinner extends Spinner {
|
||||
private int index;
|
||||
private int pos;
|
||||
private double size;
|
||||
private int delay = 0;
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
index = 0;
|
||||
size = Options.height * 0.8d;
|
||||
size = displayContainer.height * 0.8d;
|
||||
point = new double[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getPoint()
|
||||
{
|
||||
public double[] getPoint() {
|
||||
if (!waitForDelay()) {
|
||||
return point;
|
||||
}
|
||||
delay = 0;
|
||||
|
||||
final int INC = 50;
|
||||
|
||||
if( index == 0 )
|
||||
{
|
||||
point[0] = Options.width / 2d + size / 2d - pos;
|
||||
point[1] = Options.height / 2d - size / 2d;
|
||||
if( index == 0 ) {
|
||||
point[0] = displayContainer.width / 2d + size / 2d - pos;
|
||||
point[1] = displayContainer.height / 2d - size / 2d;
|
||||
index++;
|
||||
}
|
||||
else if( index == 1 )
|
||||
{
|
||||
point[0] = Options.width / 2 - size / 2;
|
||||
point[1] = Options.height / 2 - size / 2 + pos;
|
||||
} else if( index == 1 ) {
|
||||
point[0] = displayContainer.width / 2 - size / 2;
|
||||
point[1] = displayContainer.height / 2 - size / 2 + pos;
|
||||
index++;
|
||||
}
|
||||
else if( index == 2 )
|
||||
{
|
||||
point[0] = Options.width / 2 - size / 2 + pos;
|
||||
point[1] = Options.height / 2 + size / 2;
|
||||
} else if( index == 2 ) {
|
||||
point[0] = displayContainer.width / 2 - size / 2 + pos;
|
||||
point[1] = displayContainer.height / 2 + size / 2;
|
||||
index++;
|
||||
}
|
||||
else if( index == 3 )
|
||||
{
|
||||
point[0] = Options.width / 2 + size / 2;
|
||||
point[1] = Options.height / 2 + size / 2 - pos;
|
||||
} else if( index == 3 ) {
|
||||
point[0] = displayContainer.width / 2 + size / 2;
|
||||
point[1] = displayContainer.height / 2 + size / 2 - pos;
|
||||
pos += INC;
|
||||
if( pos > size )
|
||||
{
|
||||
if( pos > size ) {
|
||||
pos = INC;
|
||||
}
|
||||
index = 0;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package yugecin.opsudance.spinners;
|
||||
|
||||
import yugecin.opsudance.options.Options;
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
public class RektSpinner extends Spinner {
|
||||
|
||||
@@ -25,11 +25,11 @@ public class RektSpinner extends Spinner {
|
||||
public void init() {
|
||||
init(new double[][] {
|
||||
{ 10, 10 },
|
||||
{ Options.width / 2d, 10 },
|
||||
{ Options.width - 10, 10 },
|
||||
{ Options.width - 10, Options.height - 10 },
|
||||
{ Options.width / 2d, Options.height - 10 },
|
||||
{ 10, Options.height - 10 }
|
||||
{ displayContainer.width / 2d, 10 },
|
||||
{ displayContainer.width - 10, 10 },
|
||||
{ displayContainer.width - 10, displayContainer.height - 10 },
|
||||
{ displayContainer.width / 2d, displayContainer.height - 10 },
|
||||
{ 10, displayContainer.height - 10 }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user