Wiki
Clone wikiRogueSharp / RogueSharp / Map / IndexFor_1
MapIndexFor Method (Int32, Int32)
Get the single dimensional array index for a Cell at the specified location using the formula: index = ( y * Width ) + x
Namespace: RogueSharp
Assembly:
Syntax
public int IndexFor( int x, int y )
Parameters
x
Type: SystemInt32
X location of the Cell index to get starting with 0 as the farthest left
y
Type: SystemInt32
Y location of the Cell index to get, starting with 0 as the top
Return Value
Type: Int32
An index for the Cell at the specified location useful if storing Cells in a single dimensional array
Implements
See Also
Reference
Map Class
RogueSharp Namespace
[4]: 2014-2016 Faron Bracy
Updated