Skip to content

Commit

Permalink
Make GridPoint classes implement Serializable and provide toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxrtech committed Jul 20, 2015
1 parent 154c0cb commit f05b59c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions gdx/src/com/badlogic/gdx/math/GridPoint2.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

package com.badlogic.gdx.math;

import com.badlogic.gdx.utils.NumberUtils;
import java.io.Serializable;

/** A point in a 2D grid, with integer x and y coordinates
*
* @author badlogic */
public class GridPoint2 {
public class GridPoint2 implements Serializable {
private static final long serialVersionUID = -4019969926331717380L;

public int x;
public int y;

Expand Down Expand Up @@ -85,4 +87,9 @@ public int hashCode () {
result = prime * result + this.y;
return result;
}

@Override
public String toString() {
return "(" + x + ", " + y + ")";
}
}
11 changes: 9 additions & 2 deletions gdx/src/com/badlogic/gdx/math/GridPoint3.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

package com.badlogic.gdx.math;

import com.badlogic.gdx.utils.NumberUtils;
import java.io.Serializable;

/** A point in a 3D grid, with integer x and y coordinates
*
* @author badlogic */
public class GridPoint3 {
public class GridPoint3 implements Serializable {
private static final long serialVersionUID = 5922187982746752830L;

public int x;
public int y;
public int z;
Expand Down Expand Up @@ -93,4 +95,9 @@ public int hashCode () {
result = prime * result + this.z;
return result;
}

@Override
public String toString() {
return "(" + x + ", " + y + ", " + z + ")";
}
}

0 comments on commit f05b59c

Please sign in to comment.