Package net.sf.gridarta.model.gameobject
Class MultiPositionData
- java.lang.Object
-
- net.sf.gridarta.model.gameobject.MultiPositionData
-
public class MultiPositionData extends java.lang.Object
The MultiPositionData class stores an array of numbers which is required in order to calculate display positions of ISO multi-part objects.
-
-
Field Summary
Fields Modifier and Type Field Description static int
Y_DIM
Number of rows in the array.
-
Constructor Summary
Constructors Constructor Description MultiPositionData(@NotNull IsoMapSquareInfo isoMapSquareInfo)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHeight(int shapeID)
Returns the total height for a multi-square image.int
getWidth(int shapeID)
Returns the total width for a multi-square image.int
getXOffset(int shapeID, int positionID)
Calculate the x-offset from the leftmost pixel of the big face image and the default x-position (The default position is where a single-square image would be put).int
getYOffset(int shapeID, int positionID)
Calculate the y-offset from the topmost pixel of the big face image and the default y-position (The default position is where a single-square image would be put).void
load(@NotNull ErrorView errorView, @NotNull java.net.URL url)
Load the array-data from file.
-
-
-
Field Detail
-
Y_DIM
public static final int Y_DIM
Number of rows in the array.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiPositionData
public MultiPositionData(@NotNull @NotNull IsoMapSquareInfo isoMapSquareInfo)
Creates a new instance.- Parameters:
isoMapSquareInfo
- the iso square info to use
-
-
Method Detail
-
load
public void load(@NotNull @NotNull ErrorView errorView, @NotNull @NotNull java.net.URL url)
Load the array-data from file. An error is reported when the numbers in the file don't match expected array dimensions.- Parameters:
errorView
- the error view for reporting errorsurl
- the URL of the archdef file to read
-
getXOffset
public int getXOffset(int shapeID, int positionID)
Calculate the x-offset from the leftmost pixel of the big face image and the default x-position (The default position is where a single-square image would be put).- Parameters:
shapeID
- ID number for the multi-square shape (-> rows in position data file)positionID
- number of square in the big bunch- Returns:
- x-offset
-
getYOffset
public int getYOffset(int shapeID, int positionID)
Calculate the y-offset from the topmost pixel of the big face image and the default y-position (The default position is where a single-square image would be put).- Parameters:
shapeID
- ID number for the multi-square shape (-> rows in position data file)positionID
- number of square in the big bunch- Returns:
- y-offset
-
getWidth
public int getWidth(int shapeID)
Returns the total width for a multi-square image.- Parameters:
shapeID
- the shape ID- Returns:
- the width in pixels
-
getHeight
public int getHeight(int shapeID)
Returns the total height for a multi-square image.- Parameters:
shapeID
- the shape ID- Returns:
- the height in pixels
-
-