Class HTower
Class HTower
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----HTower
- public class HTower (View complete Source)
- extends Panel
-
HTower(int, int, int, int)
- Constructor to be used if we are not passed an array of disk
images .
-
HTower(int, int, int, int, Image, Image[])
- Constructor which takes as its last two arguments an image for
the base of the tower and an array of disk images, respectively.
-
inXRange(int, int)
-
-
MaxNumberOfDisks()
-
-
NumberOfDisks()
-
-
paint(Graphics)
-
-
pop()
-
-
push(int)
-
HTower
public HTower(int screen_x,
int screen_y,
int maxD,
int numD)
- Constructor to be used if we are not passed an array of disk
images . . .
Instead, we just use integer disk weights.
HTower
public HTower(int screen_x,
int screen_y,
int maxD,
int numD,
Image base,
Image DiskImages[])
- Constructor which takes as its last two arguments an image for
the base of the tower and an array of disk images, respectively.
(It is assumed that the index of each image in the array represents
that disk's integer weight)
paint
public void paint(Graphics g)
- Overrides:
- paint in class Component
NumberOfDisks
public int NumberOfDisks()
MaxNumberOfDisks
public int MaxNumberOfDisks()
inXRange
public boolean inXRange(int some_x,
int dist)
push
public boolean push(int diskWeight)
pop
public int pop()