moagg.util
Class MatrixTool

java.lang.Object
  extended by moagg.util.MatrixTool

public class MatrixTool
extends java.lang.Object


Constructor Summary
MatrixTool()
           
 
Method Summary
static double getAverageTileValue(Matrix matrix, MoaggGameObject object, double oobValue)
          For a given matrix and game object, this method calculates the average value considering that every matrix row/column represents a tile row/column of a map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixTool

public MatrixTool()
Method Detail

getAverageTileValue

public static double getAverageTileValue(Matrix matrix,
                                         MoaggGameObject object,
                                         double oobValue)
For a given matrix and game object, this method calculates the average value considering that every matrix row/column represents a tile row/column of a map. The actual code was ported from the original moagg code.

Parameters:
matrix - A matrix containing gravity/friction/whatoever information about a map.
object - The game object for which to calculate the average value.
oobValue - A default value to use if the game object lies (partially) out-of-bounds.
Returns:
The average value of the entity represented by the matrix for the game object.


Copyright © 2008. All Rights Reserved.