Updated whitespace and formatting
Replaced remaining usages of IComparable with Comparable Remove useless IComparable interface
This commit is contained in:
parent
9cfedf1e78
commit
d4c31e72c2
@ -90,15 +90,15 @@ public class Game implements IDisposable
|
||||
public boolean getIsActive()
|
||||
{
|
||||
boolean isVisible = false;
|
||||
|
||||
|
||||
if (GamerServicesDispatcher.IsInitialized())
|
||||
{
|
||||
isVisible = Guide.IsVisible();
|
||||
}
|
||||
|
||||
|
||||
return isActive;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -106,7 +106,7 @@ public class Game implements IDisposable
|
||||
{
|
||||
return isMouseVisible;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
@ -378,7 +378,7 @@ public class Game implements IDisposable
|
||||
|
||||
if (isFixedTimeStep)
|
||||
{
|
||||
while (elapsedUpdateTime.CompareTo(TargetElapsedTime) == -1)
|
||||
while (elapsedUpdateTime.compareTo(TargetElapsedTime) == -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -401,7 +401,7 @@ public class Game implements IDisposable
|
||||
|
||||
elapsedUpdateTime = TimeSpan.FromMilliseconds(getTicks() - gameTime.getTotalGameTime().getTotalMilliseconds());
|
||||
|
||||
if (isFixedTimeStep && elapsedUpdateTime.CompareTo(TargetElapsedTime) == 1)
|
||||
if (isFixedTimeStep && elapsedUpdateTime.compareTo(TargetElapsedTime) == 1)
|
||||
{
|
||||
gameTime.setIsRunningSlowly(true);
|
||||
}
|
||||
|
@ -36,19 +36,20 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
* Gets or sets the maximum depth of the clip volume.
|
||||
*/
|
||||
public float MaxDepth;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the aspect ratio used by the viewport.
|
||||
*/
|
||||
public float getAspectRatio()
|
||||
{
|
||||
if ((this.Height != 0) && (this.Width != 0))
|
||||
{
|
||||
return (((float) this.Width) / ((float) this.Height));
|
||||
}
|
||||
return 0f;
|
||||
{
|
||||
return (((float) this.Width) / ((float) this.Height));
|
||||
}
|
||||
|
||||
return 0f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the size of this resource.
|
||||
*/
|
||||
@ -56,7 +57,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
{
|
||||
return new Rectangle(X, Y, Width, Height);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the size of this resource.
|
||||
*/
|
||||
@ -67,7 +68,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
Width = bounds.Width;
|
||||
Height = bounds.Height;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the title safe area of the current viewport.
|
||||
*/
|
||||
@ -75,7 +76,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
{
|
||||
return new Rectangle(X, Y, Width, Height);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates an instance of this object.
|
||||
*
|
||||
@ -100,7 +101,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
MinDepth = 0f;
|
||||
MaxDepth = 1f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates an instance of this object.
|
||||
*
|
||||
@ -116,18 +117,16 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
MinDepth = 0f;
|
||||
MaxDepth = 1f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof Viewport)
|
||||
return this.Equals((Viewport)obj);
|
||||
return false;
|
||||
return (obj instanceof Viewport) ? this.Equals((Viewport)obj) : false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -137,7 +136,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
(this.Width == other.Width) && (this.Height == other.Height) &&
|
||||
(this.MaxDepth == other.MaxDepth) && (this.MinDepth == other.MinDepth));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a string representation of this object.
|
||||
*/
|
||||
@ -145,13 +144,14 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
{
|
||||
return String.format(Locale.getDefault(), "{{X:%i Y:%i Width:%i Height:%i MinDepth:%f MaxDepth:%f}}", X, Y, Width, Height, MinDepth, MaxDepth);
|
||||
}
|
||||
|
||||
|
||||
private static boolean WithinEpsilon(float a, float b)
|
||||
{
|
||||
float num = a - b;
|
||||
return ((-1.401298E-45f <= num) && (num <= 1.401298E-45f));
|
||||
}
|
||||
|
||||
{
|
||||
float num = a - b;
|
||||
|
||||
return ((-1.401298E-45f <= num) && (num <= 1.401298E-45f));
|
||||
}
|
||||
|
||||
/**
|
||||
* Projects a 3D vector from object space into screen space.
|
||||
*
|
||||
@ -168,20 +168,20 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
* The world matrix.
|
||||
*/
|
||||
public Vector3 Project(Vector3 source, Matrix projection, Matrix view, Matrix world)
|
||||
{
|
||||
Matrix matrix = Matrix.Multiply(Matrix.Multiply(world, view), projection);
|
||||
Vector3 vector = Vector3.Transform(source, matrix);
|
||||
float a = (((source.X * matrix.M14) + (source.Y * matrix.M24)) + (source.Z * matrix.M34)) + matrix.M44;
|
||||
if (!WithinEpsilon(a, 1f))
|
||||
{
|
||||
vector.Divide(a);
|
||||
}
|
||||
vector.X = (((vector.X + 1f) * 0.5f) * this.Width) + this.X;
|
||||
vector.Y = (((-vector.Y + 1f) * 0.5f) * this.Height) + this.Y;
|
||||
vector.Z = (vector.Z * (this.MaxDepth - this.MinDepth)) + this.MinDepth;
|
||||
return vector;
|
||||
}
|
||||
|
||||
{
|
||||
Matrix matrix = Matrix.Multiply(Matrix.Multiply(world, view), projection);
|
||||
Vector3 vector = Vector3.Transform(source, matrix);
|
||||
float a = (((source.X * matrix.M14) + (source.Y * matrix.M24)) + (source.Z * matrix.M34)) + matrix.M44;
|
||||
if (!WithinEpsilon(a, 1f))
|
||||
{
|
||||
vector.Divide(a);
|
||||
}
|
||||
vector.X = (((vector.X + 1f) * 0.5f) * this.Width) + this.X;
|
||||
vector.Y = (((-vector.Y + 1f) * 0.5f) * this.Height) + this.Y;
|
||||
vector.Z = (vector.Z * (this.MaxDepth - this.MinDepth)) + this.MinDepth;
|
||||
return vector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a screen space point into a corresponding point in world space.
|
||||
*
|
||||
@ -198,7 +198,7 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
* The world matrix.
|
||||
*/
|
||||
public Vector3 Unproject(Vector3 source, Matrix projection, Matrix view, Matrix world)
|
||||
{
|
||||
{
|
||||
Matrix matrix = Matrix.Invert(Matrix.Multiply(Matrix.Multiply(world, view), projection));
|
||||
source.X = (((source.X - this.X) / ((float) this.Width)) * 2f) - 1f;
|
||||
source.Y = -((((source.Y - this.Y) / ((float) this.Height)) * 2f) - 1f);
|
||||
@ -210,5 +210,5 @@ public final class Viewport extends ValueType implements IEquatable<Viewport>
|
||||
vector.Divide(a);
|
||||
}
|
||||
return vector;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,11 +36,11 @@ public final class Artist implements IEquatable<Artist>, IDisposable
|
||||
|
||||
private Artist()
|
||||
{
|
||||
//this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
//this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
}
|
||||
|
||||
/*Artist(uint handle)
|
||||
|
@ -11,7 +11,7 @@ import Microsoft.Xna.Framework.*;
|
||||
public final class StorageDevice
|
||||
{
|
||||
public static final Event<EventArgs> DeviceChanged = new Event<EventArgs>();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the amount of free space on the device.
|
||||
*/
|
||||
@ -19,7 +19,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets whether the device is connected.
|
||||
*/
|
||||
@ -27,7 +27,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the total amount of space on the device.
|
||||
*/
|
||||
@ -35,7 +35,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begins the process for opening a StorageContainer containing any files for the specified title.
|
||||
*
|
||||
@ -52,7 +52,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begins the process for displaying the storage device selector user interface, and for specifying the size of the data to be written to the storage device and the callback implemented when the player chooses a device.
|
||||
*
|
||||
@ -72,7 +72,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begins the process for displaying the storage device selector user interface, and for specifying a callback implemented when the player chooses a device.
|
||||
*
|
||||
@ -86,7 +86,7 @@ public final class StorageDevice
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begins the process for displaying the storage device selector user interface, for specifying the player who requested the save operation, for setting the size of data to be written to the storage device, and for naming the callback implemented when the player chooses a device.
|
||||
*
|
||||
@ -108,11 +108,13 @@ public final class StorageDevice
|
||||
public static IAsyncResult BeginShowSelector(PlayerIndex player, int sizeInBytes, int directoryCount, AsyncCallback callback, Object state)
|
||||
{
|
||||
if (player.ordinal() > PlayerIndex.One.ordinal())
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begins the process for displaying the storage device selector user interface; specifies the callback implemented when the player chooses a device.
|
||||
*
|
||||
@ -128,11 +130,13 @@ public final class StorageDevice
|
||||
public static IAsyncResult BeginShowSelector(PlayerIndex player, AsyncCallback callback, Object state)
|
||||
{
|
||||
if (player.ordinal() > PlayerIndex.One.ordinal())
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param titleName
|
||||
@ -142,7 +146,7 @@ public final class StorageDevice
|
||||
{
|
||||
// TODO: implement
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ends the process for opening a StorageContainer.
|
||||
*
|
||||
@ -152,11 +156,13 @@ public final class StorageDevice
|
||||
public StorageContainer EndOpenContainer(IAsyncResult result)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
throw new ArgumentNullException("result");
|
||||
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ends the display of the storage selector user interface.
|
||||
*
|
||||
@ -166,8 +172,10 @@ public final class StorageDevice
|
||||
public static StorageDevice EndShowSelector(IAsyncResult result)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
throw new ArgumentNullException("result");
|
||||
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
private static final long serialVersionUID = 1936158280585747234L;
|
||||
private Object m_actualValue;
|
||||
private static String _rangeMessage;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the argument value that causes this exception.
|
||||
*
|
||||
@ -21,16 +21,17 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
{
|
||||
return m_actualValue;
|
||||
}
|
||||
|
||||
|
||||
private static String getRangeMessage()
|
||||
{
|
||||
if (_rangeMessage == null)
|
||||
{
|
||||
_rangeMessage = "Specified argument was out of the range of valid values.";
|
||||
}
|
||||
return _rangeMessage;
|
||||
if (_rangeMessage == null)
|
||||
{
|
||||
_rangeMessage = "Specified argument was out of the range of valid values.";
|
||||
}
|
||||
|
||||
return _rangeMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the ArgumentOutOfRangeException class.
|
||||
*/
|
||||
@ -38,7 +39,7 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
{
|
||||
super(getRangeMessage());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the ArgumentOutOfRangeException class with the name of the parameter that causes this exception.
|
||||
*
|
||||
@ -63,7 +64,7 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
{
|
||||
super(message, innerException);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the ArgumentOutOfRangeException class with a specified error message and the name of the parameter that causes this exception.
|
||||
*
|
||||
@ -77,7 +78,7 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
{
|
||||
super(message, paramName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the ArgumentOutOfRangeException class with a specified error message, the parameter name, and the value of the argument.
|
||||
*
|
||||
@ -93,6 +94,6 @@ public class ArgumentOutOfRangeException extends ArgumentException
|
||||
public ArgumentOutOfRangeException(String paramName, Object actualValue, String message)
|
||||
{
|
||||
super(message, paramName);
|
||||
this.m_actualValue = actualValue;
|
||||
this.m_actualValue = actualValue;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.*;
|
||||
public class Event<T extends EventArgs>
|
||||
{
|
||||
private List<EventHandler<T>> handlers;
|
||||
|
||||
|
||||
/**
|
||||
* Use this to determine whether you can actually raise the event,
|
||||
* since if the list is empty, you'll get an InvalidOperationException.
|
||||
@ -21,7 +21,7 @@ public class Event<T extends EventArgs>
|
||||
{
|
||||
return !handlers.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new instance of this Object.
|
||||
*/
|
||||
@ -29,7 +29,7 @@ public class Event<T extends EventArgs>
|
||||
{
|
||||
handlers = new ArrayList<EventHandler<T>>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a handler for this event
|
||||
*
|
||||
@ -40,7 +40,7 @@ public class Event<T extends EventArgs>
|
||||
{
|
||||
this.handlers.add(handler);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes the specified handler for this event
|
||||
*
|
||||
@ -52,11 +52,13 @@ public class Event<T extends EventArgs>
|
||||
public synchronized void removeHandler(EventHandler<T> handler)
|
||||
{
|
||||
if (this.handlers.isEmpty())
|
||||
{
|
||||
throw new InvalidOperationException("Cannot remove event handler because none have been assigned.");
|
||||
|
||||
}
|
||||
|
||||
this.handlers.remove(handler);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Raises the event.
|
||||
*
|
||||
@ -64,7 +66,7 @@ public class Event<T extends EventArgs>
|
||||
* The Object that raised the event.
|
||||
*
|
||||
* @param e
|
||||
* An instance of System.EventArgs that provides information about the event.
|
||||
* An instance of {@link System.EventArgs} that provides information about the event.
|
||||
*
|
||||
* @throws InvalidOperationException
|
||||
* Thrown when the event is raised with no event handlers assigned.
|
||||
@ -72,8 +74,10 @@ public class Event<T extends EventArgs>
|
||||
public synchronized void raise(Object sender, T e)
|
||||
{
|
||||
if (this.handlers.isEmpty())
|
||||
{
|
||||
throw new InvalidOperationException("Trying to raise an event without Event Handlers.");
|
||||
|
||||
}
|
||||
|
||||
for (EventHandler<T> handler : handlers)
|
||||
{
|
||||
handler.Invoke(sender, e);
|
||||
|
@ -11,7 +11,7 @@ public class EventArgs
|
||||
* Represents an event with no event data.
|
||||
*/
|
||||
public static final EventArgs Empty = new EventArgs();
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new Instance of the System.EventArgs class.
|
||||
*/
|
||||
|
@ -1,14 +1,22 @@
|
||||
package System;
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents the method that will handle an event.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
* @param <T>
|
||||
* The type of EventArgs to use in this EventHandler.
|
||||
* The type of the event data generated by the event.
|
||||
*/
|
||||
public interface EventHandler<T>
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @param sender
|
||||
* The source of the event.
|
||||
*
|
||||
* @param e
|
||||
* An {@link System.EventArgs} that contains the event data.
|
||||
*/
|
||||
void Invoke(Object sender, T e);
|
||||
}
|
||||
|
||||
|
@ -13,9 +13,9 @@ public class FormatException extends SystemException
|
||||
* Initializes a new instance of the FormatException class.
|
||||
*/
|
||||
public FormatException()
|
||||
{
|
||||
{
|
||||
super("One of the identified items was in an invalid format.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the FormatException class with a specified error message.
|
||||
@ -23,22 +23,22 @@ public class FormatException extends SystemException
|
||||
* @param message
|
||||
* The message that describes the error.
|
||||
*/
|
||||
public FormatException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
public FormatException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the FormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.
|
||||
*
|
||||
* @param message
|
||||
* The error message that explains the reason for the exception.
|
||||
*
|
||||
* @param innerException
|
||||
* The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.
|
||||
*/
|
||||
public FormatException(String message, RuntimeException innerException)
|
||||
{
|
||||
super(message, innerException);
|
||||
}
|
||||
/**
|
||||
* Initializes a new instance of the FormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.
|
||||
*
|
||||
* @param message
|
||||
* The error message that explains the reason for the exception.
|
||||
*
|
||||
* @param innerException
|
||||
* The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.
|
||||
*/
|
||||
public FormatException(String message, RuntimeException innerException)
|
||||
{
|
||||
super(message, innerException);
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
package System;
|
||||
|
||||
/**
|
||||
* Defines a generalized comparison method that a value type or class implements to create a type-specific comparison method for ordering instances.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
* @param <T>
|
||||
*/
|
||||
public interface IComparable<T>
|
||||
{
|
||||
/**
|
||||
* Compares the current object with an object of the same type.
|
||||
*
|
||||
* @param other
|
||||
* An object to compare with this object.
|
||||
*
|
||||
* @return
|
||||
* A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter. Zero This object is equal to other. Greater than zero This object is greater than other.
|
||||
*/
|
||||
public int CompareTo(T other);
|
||||
}
|
@ -17,7 +17,7 @@ public class NotSupportedException extends SystemException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the NotSupportedException class with a specified error message.
|
||||
*
|
||||
@ -29,7 +29,7 @@ public class NotSupportedException extends SystemException
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the NotSupportedException class with a specified error message and a reference to the inner exception that is the cause of this exception.
|
||||
*
|
||||
|
@ -15,7 +15,7 @@ public class SystemException extends RuntimeException
|
||||
public SystemException()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the SystemException class with a specified error message.
|
||||
*
|
||||
@ -26,7 +26,7 @@ public class SystemException extends RuntimeException
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception.
|
||||
*
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user