it is done

This commit is contained in:
Anuken
2019-12-25 01:39:38 -05:00
parent 5b21873f3c
commit 514d4817c8
488 changed files with 4572 additions and 4574 deletions

View File

@@ -0,0 +1,21 @@
package mindustry.world;
/** Methods for a packed position 'struct', contained in an int. */
public class Pos{
public static final int invalid = get(-1, -1);
/** Returns packed position from an x/y position. The values must be within short limits. */
public static int get(int x, int y){
return (((short)x) << 16) | (((short)y) & 0xFFFF);
}
/** Returns the x component of a position. */
public static short x(int pos){
return (short)(pos >>> 16);
}
/** Returns the y component of a position. */
public static short y(int pos){
return (short)(pos & 0xFFFF);
}
}