PuyoPuyo Documentation


puyopuyo
Class puyo

java.lang.Object
  extended by puyopuyo.puyo
Direct Known Subclasses:
backEnd

public class puyo
extends java.lang.Object

Creates a puyo object that holds all the its properties- the image representing the puyo, logical x and y positions (in array boardMap) and a character representing the color of the puyo.


Field Summary
private  char color
          Holds the color of the puyo.
private  java.awt.Image image
          Holds the image that represents the puyo.
private  int x
          Holds the X-Co-ordinate of the puyo in backEnd.boardMap
private  int y
          Holds the Y-Co-ordinate of the puyo
 
Constructor Summary
puyo()
          Creates a default puyo without assigning any image or color to it.
puyo(java.lang.String filename, char c)
          Creates a new puyo and associates image file filename to the puyo and sets its color to c.
 
Method Summary
 char getColor()
          Returns the color of the puyo - 'r' - Red 'g' - Green 'b' - Blue 'y' - Yellow
 java.awt.Image getImage()
          Returns the image associated with the puyo.
 int getX()
          Returns the X-Co-ordinate of the puyo in boardMap.
 int getY()
          Returns the Y-Co-ordinate of the puyo in the boardMap
 void setX(int xPos)
          Sets the X-Co-ordinate of the puyo in boardMap to xPos.
 void setY(int yPos)
          Sets the Y-Co-ordinate of the puyo in boardMap to yPos.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

private java.awt.Image image
Holds the image that represents the puyo.


x

private int x
Holds the X-Co-ordinate of the puyo in backEnd.boardMap


y

private int y
Holds the Y-Co-ordinate of the puyo


color

private char color
Holds the color of the puyo. The color is stored first letter of the color string. For example 'r' is stored for red.

Constructor Detail

puyo

public puyo(java.lang.String filename,
            char c)
Creates a new puyo and associates image file filename to the puyo and sets its color to c.

Parameters:
filename - File name of the image that has to be associated with the puyo.
c - Color of the puyo

Following are its possible values:

  • 'r' - Red
  • 'g' - Green
  • 'b' - Blue
  • 'y' - Yellow

puyo

public puyo()
Creates a default puyo without assigning any image or color to it.

Method Detail

getImage

public java.awt.Image getImage()
Returns the image associated with the puyo.


getX

public int getX()
Returns the X-Co-ordinate of the puyo in boardMap.


setX

public void setX(int xPos)
Sets the X-Co-ordinate of the puyo in boardMap to xPos.

Parameters:
xPos - New x position of puyo in boardMap.

getY

public int getY()
Returns the Y-Co-ordinate of the puyo in the boardMap


setY

public void setY(int yPos)
Sets the Y-Co-ordinate of the puyo in boardMap to yPos.

Parameters:
yPos - New y position of puyo in boardMap.

getColor

public char getColor()
Returns the color of the puyo -


Dev Ghai