Class Gegenstand
- java.lang.Object
-
- greenfoot.Actor
-
- MyActor
-
- Gegenstand
-
-
Field Summary
Fields Modifier and Type Field Description protected int
wert
-
Fields inherited from class MyActor
betretbar, bildnummer, imageNumbers, moveable, originalImages
-
-
Constructor Summary
Constructors Constructor Description Gegenstand(String name, boolean moveable, boolean betretbar, int wert)
erzeugt einen Standardgegenstand
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Gegenstand
erzeuge(int nr)
static Gegenstand
erzeuge(String name)
static int
getTypGegenstand(String name)
untersucht, ob name eine korrekte Bezeichnug für einen Gegenstand istint
getWert()
liefert den Wert des Gegenstandsstatic boolean
istGegenstand(String name)
untersucht, ob name eine korrekte Bezeichnug für einen Gegenstand istvoid
setLocation(int x, int y)
setLocation(x,y) fuer Roboter wird ueberschrieben, um nicht auf Wand oder anderen Roboter ziehen zu koennen!void
setRotation(int x)
setRotation(x) fuer Roboter wird verhindert!-
Methods inherited from class MyActor
addedToWorld, getBild, getName, getX, getY, istBetretbar, istBeweglich, melde, setzeBild, warne, zeichneImage
-
Methods inherited from class greenfoot.Actor
act, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getWorldOfType, intersects, isAtEdge, isTouching, move, removeTouching, setImage, setImage, turn, turnTowards
-
-
-
-
Constructor Detail
-
Gegenstand
public Gegenstand(String name, boolean moveable, boolean betretbar, int wert)
erzeugt einen Standardgegenstand
-
-
Method Detail
-
istGegenstand
public static boolean istGegenstand(String name)
untersucht, ob name eine korrekte Bezeichnug für einen Gegenstand ist- Returns:
- erg true, wenn name korrekt ist
-
getTypGegenstand
public static int getTypGegenstand(String name)
untersucht, ob name eine korrekte Bezeichnug für einen Gegenstand ist- Returns:
- erg true, wenn name korrekt ist
-
erzeuge
public static Gegenstand erzeuge(String name)
-
erzeuge
public static Gegenstand erzeuge(int nr)
-
getWert
public int getWert()
liefert den Wert des Gegenstands- Returns:
- Wert je nach Gegenstand unterschiedlich
-
setLocation
public void setLocation(int x, int y)
setLocation(x,y) fuer Roboter wird ueberschrieben, um nicht auf Wand oder anderen Roboter ziehen zu koennen! -- setzt den Roboter auf eine Kachel, deren Spalte x sowie Reihe y du hier vorgibst. Die Nummerierung beginnt jeweils bei 0 !!)- Overrides:
setLocation
in classMyActor
-
setRotation
public void setRotation(int x)
setRotation(x) fuer Roboter wird verhindert! Es ist unnoetig, da Roboter sich nur in vier Richtungen drehen koennen!- Overrides:
setRotation
in classgreenfoot.Actor
-
-