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_NAMEFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()removes all created entities (walls, boxes, containers)intgets the number of levelsbooleanis this resource available?booleanchecks whether a game is active.booleanchecks whether the player is presentvoidloadLevel(int lvl) loads a levelvoidonTurnReached(int currentTurn) This method is called when the turn number is reached.voidsets the currently playing playerMethods inherited from class games.stendhal.server.entity.mapstuff.area.AreaEntity
addBehaviour, generateRPClass, getDescriptionName, getName, getTitle, onAdded, onRemoved, setNameMethods 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, updateMethods 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, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods 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, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:TurnListenerThis method is called when the turn number is reached.- Specified by:
onTurnReachedin interfaceTurnListener- Parameters:
currentTurn- current turn number
-
isAvailable
public boolean isAvailable()Description copied from interface:AvailabilityCheckeris this resource available?- Specified by:
isAvailablein interfaceAvailabilityChecker- Returns:
- true, if the resource is available; false otherwise
-