|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.adventure.structure.Room
public class Room
This class specifies a single room (game location) in the adventure game.
Constructor Summary | |
---|---|
Room(InputManager input)
Creates a new room with the specified input manager object. |
|
Room(java.lang.String roomFile,
InputManager input)
Creates a new room with the specified parameters. |
Method Summary | |
---|---|
void |
addCameraPerspective(CameraPerspective cam,
int id)
Adds a camera perspective to the room. |
void |
addCharacter(NonPlayerCharacter character)
Adds a non player character to the room. |
void |
addController(ControllerIface cntr)
Adds an controller to the room. |
void |
addEntryPoint(EntryPoint ep)
Adds an entry point to the room. |
void |
addHotspot(AbstractInteractiveHotspot hs)
Adds an interactive hotspot to the room. |
void |
addItem(Item item)
Adds an item to the room. |
void |
addLight(LightIface light)
Adds the specified light to the room. |
void |
addParticleEffect(AbstractParticleEffect effect)
Adds a particle the effect to the room's particle effect container. |
void |
addProp(Prop prop)
Adds a prop, a passive mesh which is only used for constructing the setting of the room. |
void |
addTexProjector(TextureProjector proj)
Adds a texture projector to the room. |
void |
addTrigger(AbstractTrigger trigger)
Adds a trigger to the room. |
void |
draw(javax.media.opengl.GL gl)
Draws the room and its content. |
java.util.LinkedHashMap<java.lang.Integer,CameraPerspective> |
getCameraPerspectives()
Retuns the map of camera perspectives that is assigned to this room. |
Chapter |
getChapter()
Returns the chapter this room belongs to. |
NonPlayerCharacter |
getCharacter(java.lang.String scriptId)
Returns the nonplayer character with the specified id |
java.util.ArrayList<NonPlayerCharacter> |
getCharacters()
Returns the non player characters that are assigned to the room. |
java.util.List<ControllerIface> |
getControllers()
Returns the controllers of the room. |
AbstractEntity |
getEntityByMesh(AbstractMesh mesh)
Returns the entity that corresponds to the specified mesh object. |
EntryPoint |
getEntryPoint(java.lang.String scriptId)
Returns the entry point that correspond to the specified script id. |
java.util.List<EntryPoint> |
getEntryPoints()
Returns the entry points of the room. |
AbstractGroundMesh |
getGround()
Returns the ground mesh, if one has been added to the room, else null . |
AbstractInteractiveHotspot |
getHotspot(int screenX,
int screenY)
Returns the first found hotspot that lies under the specified screen coordinates. if none was found this method returns null . |
AbstractInteractiveHotspot |
getHotspot(java.lang.String scriptId)
Returns a hotspot by its script id. |
java.util.List<AbstractInteractiveHotspot> |
getHotspots()
Returns a list containing the hotspots of the room. |
int |
getInitialCamPerspective()
Returns the initial camera perspective of the room. |
java.util.ArrayList<Item> |
getItems()
Returns the items that are assigned to the room. |
LightIface |
getLight(int nr)
Returns the light (child of AbstractLight only!) |
java.util.LinkedList<LightIface> |
getLights()
Returns the lights of the room. |
MeshContainer |
getMeshes()
Returns the mesh container with meshes of this room. |
java.util.List<AbstractParticleEffect> |
getParticleEffects()
Returns a list containing the particle effects of the room. |
PlayableCharacter |
getPlayer()
Returns the playable character from this room. |
java.util.ArrayList<Prop> |
getProps()
Returns the props of this room. |
java.lang.String |
getScriptFile()
Returns the path to the script file that was assigned to this room. |
java.lang.String |
getScriptId()
Returns the script id (which is the room's id in the chapter, too) of the room. |
ScriptInterpreter |
getScriptInterpreter()
Returns the script interpreter used by this room. |
PositionalLight |
getShadowReferenceLight()
Returns the shadow reference light for this room. |
java.util.List<TextureProjector> |
getTexProjectors()
Returns the texture projectors of the room. |
AbstractTrigger |
getTrigger(java.lang.String triggerName)
Returns the trigger that corresponds to the specified name (which is its script id). |
java.util.List<AbstractTrigger> |
getTriggers()
Returns the list of triggers of this room. |
boolean |
hasBeenEnteredAlready()
Determines whether or not the room has been entered already. |
void |
removeAllCameraPerspectives()
Removes all camera perspectives that were assigned to this room. |
void |
removeAllCharacters()
Removes every non player character from the room. |
void |
removeAllEntryPoints()
Removes all entry points from the room. |
void |
removeAllItems()
Removes every item from the room. |
void |
removeAllLights()
Removes every light from the room. |
void |
removeAllProps()
Removes every prop from the room. |
void |
removeAllTriggers()
Removes every trigger from the room. |
void |
removeCameraPerspective(int id)
Removes the camera perspective which corresponds to the specified id from the room. |
void |
removeCharacter(NonPlayerCharacter character)
Removes a non player character from the room. |
void |
removeController(ControllerIface cntr)
Removes the specified controller from the room. |
void |
removeControllers()
Removes all controllers from the room. |
void |
removeEntryPoint(EntryPoint ep)
Removes the specified entry point from the room. |
void |
removeHotspot(AbstractInteractiveHotspot hs)
Removes the specified hotspot from the room. |
void |
removeHotspot(java.lang.String scriptId)
Removes the hotspot from the room which corresponds to the specified script id. |
void |
removeItem(Item item)
Removes an item from the room. |
void |
removeLight(LightIface light)
Removes the specified light from the room |
void |
removeParticleEffect(AbstractParticleEffect effect)
Removes the specified particle effect from the room's particle container. |
void |
removePlayer()
Removes the playable character from the room. |
void |
removeProp(Prop prop)
|
void |
removeTexProjector(TextureProjector proj)
Removes a texture projector from the room. |
void |
removeTrigger(AbstractTrigger trigger)
Removes a trigger from the room. |
void |
removeTrigger(java.lang.String triggerName)
Removes a trigger from the room by its name. |
void |
setInitialCamPerspective(int initialCam)
Sets the initial camera perspective of the room. |
void |
setPlayer(PlayableCharacter player)
Assigns the playable character to the room. |
void |
setPlayer(PlayableCharacter player,
java.lang.String entryPointId)
Assigns the playable character to the room. |
void |
setScriptFile(java.lang.String scriptFile)
Sets the script file of the room. |
void |
setScriptId(java.lang.String scriptId)
Sets the script id of the room. |
void |
setShadowReferenceLight(PositionalLight refLight)
Sets the positional light that ought to be used as a reference light for shadow casting techniques. |
void |
update(long elapsedTime)
Updates everything in the room. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Room(InputManager input)
input
- input manager objectpublic Room(java.lang.String roomFile, InputManager input)
roomFile
- path to the .room file for the roominput
- input manager objectMethod Detail |
---|
public void setScriptId(java.lang.String scriptId)
scriptId
- script id for the roompublic java.lang.String getScriptId()
public ScriptInterpreter getScriptInterpreter()
getChapter().getScriptInterpreter()
call.
public void setScriptFile(java.lang.String scriptFile)
scriptFile
- script file for the roompublic java.lang.String getScriptFile()
public boolean hasBeenEnteredAlready()
public void setInitialCamPerspective(int initialCam)
initialCam
- nr of the initial camera perspectivepublic int getInitialCamPerspective()
public Chapter getChapter()
public void addTrigger(AbstractTrigger trigger)
trigger
- trigger to add to the roompublic void removeTrigger(AbstractTrigger trigger)
public void removeTrigger(java.lang.String triggerName)
public AbstractTrigger getTrigger(java.lang.String triggerName)
null
.
triggerName
- name of the trigger to return.
public java.util.List<AbstractTrigger> getTriggers()
public void removeAllTriggers()
public void addLight(LightIface light)
light
- light to add to the roompublic void removeLight(LightIface light)
light
- light to remove from the roompublic java.util.LinkedList<LightIface> getLights()
public LightIface getLight(int nr)
null
.
nr
- number of the light to seek
public void removeAllLights()
public void setShadowReferenceLight(PositionalLight refLight)
refLight
- shadow reference lightpublic PositionalLight getShadowReferenceLight()
null
.
null
.public void addTexProjector(TextureProjector proj)
proj
- texture projector to addpublic void removeTexProjector(TextureProjector proj)
proj
- texture projector to removepublic java.util.List<TextureProjector> getTexProjectors()
public void addCameraPerspective(CameraPerspective cam, int id)
cam
- camera perspective to addid
- reference id for the perspectivepublic void removeCameraPerspective(int id)
id
- id of the perspective to remove from the roompublic void removeAllCameraPerspectives()
public java.util.LinkedHashMap<java.lang.Integer,CameraPerspective> getCameraPerspectives()
public void addEntryPoint(EntryPoint ep)
ep
- entry point to addpublic void removeEntryPoint(EntryPoint ep)
ep
- entry point to removepublic void removeAllEntryPoints()
public EntryPoint getEntryPoint(java.lang.String scriptId)
null
is returned.
scriptId
- script id of seeked entry point
public java.util.List<EntryPoint> getEntryPoints()
public void addController(ControllerIface cntr)
cntr
- controller to addpublic void removeController(ControllerIface cntr)
cntr
- controller to removepublic void removeControllers()
public java.util.List<ControllerIface> getControllers()
public void setPlayer(PlayableCharacter player)
player
- playable characterpublic void setPlayer(PlayableCharacter player, java.lang.String entryPointId)
player
- playable characterentryPointId
- script id of the entry point to take as
reference for positioning and rotating the playerpublic PlayableCharacter getPlayer()
public void removePlayer()
public void addCharacter(NonPlayerCharacter character)
character
- non player character to add to the roompublic void removeCharacter(NonPlayerCharacter character)
character
- character to remove from the roompublic java.util.ArrayList<NonPlayerCharacter> getCharacters()
public NonPlayerCharacter getCharacter(java.lang.String scriptId)
scriptId
-
public void removeAllCharacters()
public void addItem(Item item)
item
- item to add to the roompublic void removeItem(Item item)
item
- item to remove from the roompublic java.util.ArrayList<Item> getItems()
public void removeAllItems()
public void addProp(Prop prop)
getGround()
method.
prop
- prop for the settingpublic void removeProp(Prop prop)
public java.util.ArrayList<Prop> getProps()
public void removeAllProps()
public void addParticleEffect(AbstractParticleEffect effect)
effect
- particle effect to add to the roompublic void removeParticleEffect(AbstractParticleEffect effect)
effect
- particle effect to remove from the room.public java.util.List<AbstractParticleEffect> getParticleEffects()
public void addHotspot(AbstractInteractiveHotspot hs)
hs
- interactive hotspot to addpublic void removeHotspot(AbstractInteractiveHotspot hs)
hs
- interactive hotspot to removepublic void removeHotspot(java.lang.String scriptId)
scriptId
- script id of the hotspot to removepublic AbstractInteractiveHotspot getHotspot(java.lang.String scriptId)
null
.
scriptId
- seeked hotspot's script id
public AbstractInteractiveHotspot getHotspot(int screenX, int screenY)
null
.
screenX
- screen x-coordinatescreenY
- screen y-coordinate
public java.util.List<AbstractInteractiveHotspot> getHotspots()
public AbstractGroundMesh getGround()
null
.
null
.public MeshContainer getMeshes()
public AbstractEntity getEntityByMesh(AbstractMesh mesh)
null
.
mesh
- mesh that belongs to the seeked entity.
public void update(long elapsedTime)
elapsedTime
- time between two framespublic void draw(javax.media.opengl.GL gl)
gl
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |