Class StairsType
A stairs type is a set of settings for a Stairs object that is unchanged between individual stairs objects. Stairs types can be registered using Register(StairsType).
[JsonConverter(typeof(MigratingStaticJsonConverter<StairsType>), new object[] { typeof(StairsType), "PrivateTypes" })]
public class StairsType
- Inheritance
-
StairsType
- Inherited Members
- Extension Methods
Constructors
StairsType(string, int, Dictionary<Point, TextureRegion>, Point, bool, TextureRegion, params ColorScheme[])
Creates a new stairs type with the given settings.
public StairsType(string name, int price, Dictionary<Point, TextureRegion> textures, Point textureRegion, bool allowsWallpaper, TextureRegion icon, params ColorScheme[] colorSchemes)
Parameters
name
stringThe name of this stairs type.
price
intThe price of this stairs type.
textures
Dictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegion
PointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
allowsWallpaper
boolWhether this stairs type supports applying wallpaper.
icon
TextureRegionThe icon for this stairs type.
colorSchemes
ColorScheme[]The color schemes for each layer of this stairs type.
StairsType(string, int, Dictionary<Point, TextureRegion>, Point, bool, TextureRegion, ColorSettings)
Creates a new stairs type with the given settings.
public StairsType(string name, int price, Dictionary<Point, TextureRegion> textures, Point textureRegion, bool allowsWallpaper, TextureRegion icon, ColorSettings colors)
Parameters
name
stringThe name of this stairs type.
price
intThe price of this stairs type.
textures
Dictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegion
PointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
allowsWallpaper
boolWhether this stairs type supports applying wallpaper.
icon
TextureRegionThe icon for this stairs type.
colors
ColorSettingsThe color schemes for each layer of this stairs type.
StairsType(string, int, Dictionary<Point, TextureRegion>, Point, bool, params ColorScheme[])
Creates a new stairs type with the given settings.
public StairsType(string name, int price, Dictionary<Point, TextureRegion> textures, Point textureRegion, bool hasWallpaper, params ColorScheme[] colorSchemes)
Parameters
name
stringThe name of this stairs type.
price
intThe price of this stairs type.
textures
Dictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegion
PointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
hasWallpaper
boolWhether this stairs type supports applying wallpaper.
colorSchemes
ColorScheme[]The color schemes for each layer of this stairs type.
Fields
AllowsWallpaper
Whether this stairs type supports applying wallpaper.
public readonly bool AllowsWallpaper
Field Value
BasicWood
public static readonly StairsType BasicWood
Field Value
Colors
The color settings these stairs use.
public readonly ColorSettings Colors
Field Value
Icon
The icon for this stairs type.
public readonly TextureRegion Icon
Field Value
- TextureRegion
Industrial
public static readonly StairsType Industrial
Field Value
Name
The name of this stairs type.
public readonly string Name
Field Value
Price
The price of this stairs type.
public readonly int Price
Field Value
TextureRegion
The texture region of this stairs type on the Textures texture atlas. Additional regions are automtaically gathered to the right of this texture region.
public readonly Point TextureRegion
Field Value
- Point
Textures
The texture atlas that this stairs type's TextureRegion is on.
public readonly Dictionary<Point, TextureRegion> Textures
Field Value
- Dictionary<Point, TextureRegion>
Types
The set of all currently registered stairs types.
public static readonly ReadOnlyDictionary<string, StairsType> Types
Field Value
Methods
Draw(GameTime, SpriteBatch, Map, Point, int, Vector2, Direction2, Direction2, int[], Wallpaper, float, float, Color?)
Draws this stairs type in the world.
public virtual void Draw(GameTime time, SpriteBatch batch, Map map, Point position, int floor, Vector2 drawPos, Direction2 rotation, Direction2 visualRotation, int[] colorIndices, Wallpaper wallpaper, float scale = 1, float depthOffset = 0, Color? overrideColor = null)
Parameters
time
GameTimeThe game time.
batch
SpriteBatchThe sprite batch to use for drawing.
map
MapThe map to use as a basis for column-based drawing.
position
PointThe world position to use for drawing.
floor
intThe floor to use for drawing.
drawPos
Vector2The draw position, or screen position, to use for drawing.
rotation
Direction2The rotation, in world space.
visualRotation
Direction2The visual rotation, optionally with camera rotation applied.
colorIndices
int[]The color indices to use for each Colors entry.
wallpaper
WallpaperThe wallpaper to draw on this stairs type, or null to draw none.
scale
floatThe scale to draw with.
depthOffset
floatAn optional added depth offset.
overrideColor
Color?A color that should optionally be used for drawing instead of the passed
colorIndices
.
DrawUi(Element, SpriteBatch, GameTime, Map, int[], Wallpaper, float)
Draws this stairs type in a UI context, meaning the stairs are not currently in the world.
public virtual void DrawUi(Element e, SpriteBatch batch, GameTime time, Map map, int[] colorIndices, Wallpaper wallpaper, float drawScale = 0.3)
Parameters
e
ElementThe element to base scaling and positioning on.
batch
SpriteBatchThe sprite batch to use for drawing.
time
GameTimeThe game time.
map
MapThe map to use as a basis for column-based drawing.
colorIndices
int[]The color indices to use for each ColorSettings entry.
wallpaper
WallpaperThe wallpaper to draw the stairs with.
drawScale
floatThe scale to draw with.
Register(StairsType)
Registers the given stairs type into the Types registry.
public static StairsType Register(StairsType type)
Parameters
type
StairsTypeThe stairs type to register.
Returns
- StairsType
The registered stairs type, for chaining.