|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.PuyoGame
public class PuyoGame
Puyo (a game like Tetris) is made mostly of CodeSimian code. That code sometimes uses reflection to call Java functions, like the function(s) in this class.
Constructor Summary | |
---|---|
PuyoGame()
|
Method Summary | |
---|---|
static int[] |
biggestGroupOfSquares(CS[] listOfSquares,
int squaresWide,
java.lang.String fileNameOfEmptySquare)
Chooses which squares to delete (you should replace them with pictures of empty squares). |
static boolean |
changeAllOfOneFileNameToAnOther(CS[] listOfSquares,
java.lang.String fileNameFrom,
java.lang.String fileNameTo)
example: change all filenames 'redFace.jpg' to 'empty.jpg' to delete all the redFace squares. |
static int |
deleteByKeywordOrName(CS listOfSquares,
java.lang.String keywordOrNameOfACSToDelete,
CS replaceWithACopyOfMe)
returns how many CSs were deleted from listOfSquares (and replaced with replaceWith) |
static int[] |
getAdjacentSquares(int totalSquares,
int squaresWide,
int squareIndex)
Returns the indexs of the squares adjacent to squareIndex. |
static boolean |
reverse(CS list)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PuyoGame()
Method Detail |
---|
public static int[] biggestGroupOfSquares(CS[] listOfSquares, int squaresWide, java.lang.String fileNameOfEmptySquare)
listOfSquares[]
- the squares on the game board, same as CodeSimian.Squares.P(0)squaresWide
- a 1-dimensional array is being used as a 2-dimensional array. How many squares per row?fileNameOfEmptySquare
- is needed so groups of adjacent empty squares will not be returned.
public static int[] getAdjacentSquares(int totalSquares, int squaresWide, int squareIndex)
public static boolean changeAllOfOneFileNameToAnOther(CS[] listOfSquares, java.lang.String fileNameFrom, java.lang.String fileNameTo)
public static int deleteByKeywordOrName(CS listOfSquares, java.lang.String keywordOrNameOfACSToDelete, CS replaceWithACopyOfMe)
public static boolean reverse(CS list)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |