public abstract class Item
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
double |
h
The height of the item image
|
java.awt.image.BufferedImage |
image
Stores the items image
|
static java.lang.String |
IMAGE_BASE_PATH
Stores the base path of the filenames for item images
|
java.lang.String |
imageFilename
The item image filename
|
int |
item_num_id
The item number ID
|
static Item[] |
items
Stores all of the different items
|
java.lang.String |
name
The item name
|
int |
price
The item price
|
double |
w
The width of the item image
|
double |
x
The x position of the item
|
double |
y
The y position of the item
|
| Constructor and Description |
|---|
Item()
The default constructor
|
Item(int item_num_id,
java.lang.String name,
int price,
java.lang.String imageFilename)
The general constructor used to create the item
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(java.awt.Graphics g)
Draws the item
|
static void |
updateItemList()
"Downloads" all of the item information from the server so the client can use the information
|
abstract void |
use()
Abstract function for child classes when Sonic uses an item
|
public static final java.lang.String IMAGE_BASE_PATH
public static Item[] items
public int item_num_id
public java.lang.String name
public int price
public java.lang.String imageFilename
public java.awt.image.BufferedImage image
public double x
public double y
public double w
public double h
public Item()
public Item(int item_num_id,
java.lang.String name,
int price,
java.lang.String imageFilename)
item_num_id - The ID of the itemname - The name of the itemprice - The price of the itemimageFilename - The filename of the itempublic void paint(java.awt.Graphics g)
g - An instance of the Graphics objectpublic abstract void use()
public static void updateItemList()