mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-09 17:02:53 +00:00
First commit
Change-Id: I4d273faba7286288d2b9a214c87c39a76724d787
This commit is contained in:
30
src/main/java/com/l2jserver/util/Coordinate.java
Normal file
30
src/main/java/com/l2jserver/util/Coordinate.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.l2jserver.util;
|
||||
|
||||
public class Coordinate {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
|
||||
public Coordinate(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public int getDistance(Coordinate other) {
|
||||
//TODO calculation
|
||||
return x + y + z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.l2jserver.util.factory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Factory class to create {@link Collection} instances.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CollectionFactory {
|
||||
/**
|
||||
* Creates a new list of type <tt>T</tt>
|
||||
*
|
||||
* @param <T>
|
||||
* the type
|
||||
* @param type
|
||||
* the type
|
||||
* @return the created list
|
||||
*/
|
||||
public static final <T> List<T> newList(Class<T> type) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new set of type <tt>T</tt>
|
||||
*
|
||||
* @param <T>
|
||||
* the type
|
||||
* @param type
|
||||
* the type
|
||||
* @return the created set
|
||||
*/
|
||||
public static final <T> Set<T> newSet(Class<T> type) {
|
||||
return new HashSet<T>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user