C# Class TiledMapper.Map

The main class holding the map and handling editing
Show file Open project: rotators/tools Class Usage Examples

Public Methods

Method Description
Click ( int x, int y, TileMode mode ) : bool

Handler for the mouse clicking and painting a tile or wall.

ClickConvert ( ) : void

Handler for mode changing.

Compile ( string fileName, MapHeader header ) : void

Compile the map instance.

FullRedraw ( ) : void

Resize the drawing box associated with the map and invalidate the contents, forcing a full redraw.

GetTileCorridorHash ( Tile tile ) : int
GetTileHash ( Tile tile ) : int
LoadMap ( string fileName, System dbox, ValueSetterDelegate undo, ValueSetterDelegate redo, ValueSetterDelegate postMode ) : Map

Load a map instance from a file.

MouseToTile ( int h ) : int

Translation of mouse coordinates.

NewMap ( int width, int height, System dbox, ValueSetterDelegate undo, ValueSetterDelegate redo, ValueSetterDelegate postMode ) : Map

Create a new map instance and associate the form controls.

OneClick ( int x, int y, TileMode mode, bool left ) : void

Handler for a single click on a tile.

Redo ( ) : void

Handler for action redoing.

Redraw ( Graphics g ) : void

Redraw the map.

Resize ( int n, int e, int s, int w ) : void

Resize the map instance.

Save ( string fileName ) : void

Save the map instance.

StopClick ( ) : void

Handler for the stopping of painting with the mouse.

Undo ( ) : void

Handler for action undoing.

Private Methods

Method Description
Map ( int width, int height, System dbox, ValueSetterDelegate undo, ValueSetterDelegate redo, ValueSetterDelegate postMode ) : System
apply ( BaseChange change ) : void
b ( int i ) : int
bit ( int hash, int f ) : bool
bsize ( int h ) : int
clearChanges ( ) : void
clickBlocks ( int x, int y ) : bool
clickScrollPlace ( int x, int y ) : void
clickTileVariant ( int x, int y, bool left ) : void
clickTiles ( int x, int y ) : bool
clickToggleWidth ( int x, int y ) : void
compileAdapter ( FOMap m, TiledMapper.Preset p, int tx, int ty, int dir ) : void
compileEmpty ( FOMap m, TiledMapper.Preset p, int tx, int ty ) : void
compileNormalCorridor ( FOMap m, TiledMapper.Preset p, int tx, int ty ) : void
compileTile ( FOMap m, TiledMapper.Preset p, int tx, int ty ) : void
compileWide ( FOMap m, TiledMapper.Preset p, int tx, int ty ) : void
ctest ( int hash, int m, int value ) : int
ctest2 ( int hash, int m, int n, int value ) : int
drawAdapter ( int tx, int ty, int dir, Graphics g, Pen pen ) : void
drawBlock ( int tx, int ty, int dir, Graphics g, Pen pen ) : void
drawNormalCorridor ( int tx, int ty, Graphics g, Pen pen ) : void
drawTile ( int tx, int ty, Graphics g, Brush brush, Pen pen, Brush variantFontBrush, Brush scrollblockerFontBrush ) : void
drawWideCross ( int tx, int ty, Graphics g, Pen pen ) : void
drawWideEW ( int tx, int ty, Graphics g, Pen pen ) : void
drawWideNS ( int tx, int ty, Graphics g, Pen pen ) : void
fixScrollblockers ( int offsX, int offsY ) : void
getBlockPen ( ) : Pen
getFont ( ) : Font
getLinePen ( ) : Pen
getScrollblockerFontBrush ( ) : SolidBrush
getTileBrush ( bool filled ) : SolidBrush
getVariantFontBrush ( ) : SolidBrush
getWallPen ( ) : Pen
joinTiles ( Tile tiles, int width, int height ) : void
makeTiles ( int width, int height ) : ].Tile[
parseBools ( string s ) : bool[]
placeBigTile ( FOMap m, TiledMapper.BigTile bt, int tx, int ty ) : void
reattachScrollBlockers ( ) : void
redo ( bool step ) : void
redoEastResize ( ChangeInternalResize ch ) : void
redoNorthResize ( ChangeInternalResize ch ) : void
redoSouthResize ( ChangeInternalResize ch ) : void
redoWestResize ( ChangeInternalResize ch ) : void
redrawBlocks ( Graphics g ) : void
redrawGrid ( Graphics g ) : void
redrawTiles ( Graphics g ) : void
test ( Tile tile, int dir, int value ) : int
test2 ( Tile tile, int dir1, int dir2, int value ) : int
truncateChanges ( ) : void
undoEastResize ( ChangeInternalResize ch ) : void
undoNorthResize ( ChangeInternalResize ch ) : void
undoSouthResize ( ChangeInternalResize ch ) : void
undoWestResize ( ChangeInternalResize ch ) : void
updateBlock ( int tx, int ty, int dir ) : void
updateTile ( int tx, int ty ) : void

Method Details

Click() public method

Handler for the mouse clicking and painting a tile or wall.
public Click ( int x, int y, TileMode mode ) : bool
x int
y int
mode TileMode
return bool

ClickConvert() public method

Handler for mode changing.
public ClickConvert ( ) : void
return void

Compile() public method

Compile the map instance.
public Compile ( string fileName, MapHeader header ) : void
fileName string Output file name
header MapHeader Map header to be included
return void

FullRedraw() public method

Resize the drawing box associated with the map and invalidate the contents, forcing a full redraw.
public FullRedraw ( ) : void
return void

GetTileCorridorHash() public method

public GetTileCorridorHash ( Tile tile ) : int
tile Tile
return int

GetTileHash() public method

public GetTileHash ( Tile tile ) : int
tile Tile
return int

LoadMap() public static method

Load a map instance from a file.
public static LoadMap ( string fileName, System dbox, ValueSetterDelegate undo, ValueSetterDelegate redo, ValueSetterDelegate postMode ) : Map
fileName string Path for the file
dbox System Drawing box for the map representation
undo ValueSetterDelegate Delegate disabling and enabling the 'undo' action
redo ValueSetterDelegate Delegate disabling and enabling the 'redo' action
postMode ValueSetterDelegate Delegate changing edit mode on the interface
return Map

MouseToTile() public static method

Translation of mouse coordinates.
public static MouseToTile ( int h ) : int
h int A single mouse coordinate on the map.
return int

NewMap() public static method

Create a new map instance and associate the form controls.
public static NewMap ( int width, int height, System dbox, ValueSetterDelegate undo, ValueSetterDelegate redo, ValueSetterDelegate postMode ) : Map
width int Width of the map in tiles
height int Height of the map in tiles
dbox System Drawing box for the map representation
undo ValueSetterDelegate Delegate disabling and enabling the 'undo' action
redo ValueSetterDelegate Delegate disabling and enabling the 'redo' action
postMode ValueSetterDelegate Delegate changing edit mode on the interface
return Map

OneClick() public method

Handler for a single click on a tile.
public OneClick ( int x, int y, TileMode mode, bool left ) : void
x int
y int
mode TileMode
left bool
return void

Redo() public method

Handler for action redoing.
public Redo ( ) : void
return void

Redraw() public method

Redraw the map.
public Redraw ( Graphics g ) : void
g System.Drawing.Graphics Graphics object to redraw on
return void

Resize() public method

Resize the map instance.
public Resize ( int n, int e, int s, int w ) : void
n int Number or rows to be added to or removed from the north side
e int Number or columns to be added to or removed from the east side
s int Number or rows to be added to or removed from the south side
w int Number or columns to be added to or removed from the west side
return void

Save() public method

Save the map instance.
public Save ( string fileName ) : void
fileName string File name for the saved map
return void

StopClick() public method

Handler for the stopping of painting with the mouse.
public StopClick ( ) : void
return void

Undo() public method

Handler for action undoing.
public Undo ( ) : void
return void