public class Bonus
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
GEN_NEW_ID
Сгенерировать новый id
|
static int |
TYPE_LIFE
Дает новую жизнь юниту
|
static int |
TYPE_TRANSPARENT
Делает юнит невидимым на
duration ms |
Constructor and Description |
---|
Bonus(long id,
int type,
int duration,
android.content.res.Resources res) |
Modifier and Type | Method and Description |
---|---|
void |
draw(android.graphics.Canvas canvas) |
boolean |
equals(java.lang.Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
android.graphics.Rect |
getBoundsRect() |
int |
getDuration() |
long |
getID() |
int |
getType() |
int |
getX() |
int |
getY() |
void |
setPosition(int x,
int y) |
boolean |
timeOver() |
public static final int TYPE_LIFE
public static final int TYPE_TRANSPARENT
duration
mspublic static final int GEN_NEW_ID
public Bonus(long id, int type, int duration, android.content.res.Resources res)
type
- duration
- время показа бонусаres
- public void setPosition(int x, int y)
public boolean timeOver()
public void draw(android.graphics.Canvas canvas)
public android.graphics.Rect getBoundsRect()
public long getID()
public int getX()
public int getY()
public int getDuration()
public int getType()
public boolean equals(java.lang.Object o)
java.lang.Object
o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and Object.hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
equals
in class java.lang.Object
o
- the object to compare this instance with.true
if the specified object is equal to this Object
; false
otherwise.Object.hashCode()