com.aranai.dungeonator.generator
Class DungeonChunkEditor

java.lang.Object
  extended by com.aranai.dungeonator.generator.DungeonRoomEditor

public class DungeonChunkEditor
extends java.lang.Object

Handles in-game chunk editing for tiles. Supports manual construction and cuboid operations. The editing operation is destructive, and should be performed on test maps or an editor-specific map only. The editor automatically generates doorway hints and chunk boundaries to assist in the editing process. Meta data tagging commands are provided for specifying doorways, internal pathing, widget regions, and so forth.


Field Summary
private  java.lang.String activeFile
          The active file.
private  DungeonChunk chunk
          The chunk.
private  Dungeonator dungeonator
          Dungeonator instance
private  boolean hasUnsavedChanges
          Flag: editor has unsaved changes.
private  boolean isActive
          Flag: editor is active.
 
Constructor Summary
DungeonChunkEditor(Dungeonator d)
          Instantiates the dungeon chunk editor.
 
Method Summary
 void cancel()
          Cancel the edit operation.
 void cmdCancel(DCommandEvent cmd)
          Command: Cancel Edit This will cancel the editing process.
 void cmdExits(DCommandEvent cmd)
          Command: Exits Parent command for getting, setting, and removing exit data for the current chunk.
 void cmdLoad(DCommandEvent cmd)
          Command: Load DungeonChunk This will activate the editor with a specified chunk loaded.
 void cmdNew(DCommandEvent cmd)
          Command: New DungeonChunk This will activate the editor with a blank chunk.
 void cmdSave(DCommandEvent cmd)
          Command: Save DungeonChunk This will save the current DungeonChunk.
 void load(java.lang.String file)
          Load.
 void onCommand(DCommandEvent cmd)
          Process an edit command.
 void save()
          Save the currently active chunk with an inferred path and name.
 void save(java.lang.String name)
          Save the currently active chunk with an inferred path and specified name.
 void save(java.lang.String path, java.lang.String name)
          Save the currently active chunk with an specified path and specified name.
 void start(DungeonChunk c)
          Starts the editing operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dungeonator

private Dungeonator dungeonator
Dungeonator instance


isActive

private boolean isActive
Flag: editor is active.


hasUnsavedChanges

private boolean hasUnsavedChanges
Flag: editor has unsaved changes.


chunk

private DungeonChunk chunk
The chunk.


activeFile

private java.lang.String activeFile
The active file.

Constructor Detail

DungeonChunkEditor

public DungeonChunkEditor(Dungeonator d)
Instantiates the dungeon chunk editor.

Method Detail

start

public void start(DungeonChunk c)
Starts the editing operation. The specified chunk and adjacent chunks will be flattened. Doorway and border hints will be generated.

Parameters:
c - the c

load

public void load(java.lang.String file)
Load.

Parameters:
file - the file

cancel

public void cancel()
Cancel the edit operation. The DungeonChunk will be reset, no data will be saved.


save

public void save()
Save the currently active chunk with an inferred path and name.


save

public void save(java.lang.String name)
Save the currently active chunk with an inferred path and specified name.

Parameters:
name - the name

save

public void save(java.lang.String path,
                 java.lang.String name)
Save the currently active chunk with an specified path and specified name.

Parameters:
path - the path
name - the name

onCommand

public void onCommand(DCommandEvent cmd)
Process an edit command.

Parameters:
p - the player
command - the command
args - additional arguments

cmdNew

public void cmdNew(DCommandEvent cmd)
Command: New DungeonChunk This will activate the editor with a blank chunk.

Parameters:
p - the p
args - the args

cmdLoad

public void cmdLoad(DCommandEvent cmd)
Command: Load DungeonChunk This will activate the editor with a specified chunk loaded.

Parameters:
p - the player triggering the command
args - the args

cmdCancel

public void cmdCancel(DCommandEvent cmd)
Command: Cancel Edit This will cancel the editing process.

Parameters:
p - the player triggering the command

cmdSave

public void cmdSave(DCommandEvent cmd)
Command: Save DungeonChunk This will save the current DungeonChunk. The editor will remain active.

Parameters:
p - the player triggering the command
args - the args

cmdExits

public void cmdExits(DCommandEvent cmd)
Command: Exits Parent command for getting, setting, and removing exit data for the current chunk.

Parameters:
p - the p
args - the args