Class SokobanBoard
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.area.AreaEntity
games.stendhal.server.entity.mapstuff.game.SokobanBoard
- All Implemented Interfaces:
TurnListener
,Killer
,AvailabilityChecker
,Cloneable
,Iterable<String>
,Serializable
A sokoban board
- Author:
- hendrik
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID
-
Field Summary
Fields inherited from class games.stendhal.server.entity.mapstuff.area.AreaEntity
ATTR_NAME
Fields inherited from class marauroa.common.game.RPObject
INVALID_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
removes all created entities (walls, boxes, containers)int
gets the number of levelsboolean
is this resource available?boolean
checks whether a game is active.boolean
checks whether the player is presentvoid
loadLevel(int lvl)
loads a levelvoid
onTurnReached(int currentTurn)
This method is called when the turn number is reached.void
sets the currently playing playerMethods inherited from class games.stendhal.server.entity.mapstuff.area.AreaEntity
addBehaviour, generateRPClass, getDescriptionName, getName, getTitle, onAdded, onRemoved, setName
Methods inherited from class games.stendhal.server.entity.Entity
describe, getAdjacentNodes, getArea, getArea, getCursor, getDescription, getEntitySlot, getHeight, getOrigin, getResistance, getResistance, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onMoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped, update
Methods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJson
Methods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlots
Methods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SokobanBoard
creates a SokobanBoard- Parameters:
sokobanListener
- SokobanListener
-
-
Method Details
-
loadLevel
public void loadLevel(int lvl)loads a level- Parameters:
lvl
- level number
-
clear
public void clear()removes all created entities (walls, boxes, containers) -
setPlayer
sets the currently playing player- Parameters:
player
- player
-
getLevelCount
public int getLevelCount()gets the number of levels- Returns:
- number of levels
-
isGameActive
public boolean isGameActive()checks whether a game is active.- Returns:
- true, if a game is active, false otherwise
-
isPlayerPresent
public boolean isPlayerPresent()checks whether the player is present- Returns:
- true, if the player is inside the game field; false otherwise
-
onTurnReached
public void onTurnReached(int currentTurn)Description copied from interface:TurnListener
This method is called when the turn number is reached.- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
isAvailable
public boolean isAvailable()Description copied from interface:AvailabilityChecker
is this resource available?- Specified by:
isAvailable
in interfaceAvailabilityChecker
- Returns:
- true, if the resource is available; false otherwise
-