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, IReadOnlyDictionary<Point, TextureRegion>, Point, bool, TextureRegion, params ColorScheme[])
Creates a new stairs type with the given settings.
public StairsType(string name, int price, IReadOnlyDictionary<Point, TextureRegion> textures, Point textureRegion, bool allowsWallpaper, TextureRegion icon, params ColorScheme[] colorSchemes)
Parameters
namestringThe name of this stairs type.
priceintThe price of this stairs type.
texturesIReadOnlyDictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegionPointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
allowsWallpaperboolWhether this stairs type supports applying wallpaper.
iconTextureRegionThe icon for this stairs type.
colorSchemesColorScheme[]The color schemes for each layer of this stairs type.
StairsType(string, int, IReadOnlyDictionary<Point, TextureRegion>, Point, bool, TextureRegion, ColorSettings)
Creates a new stairs type with the given settings.
public StairsType(string name, int price, IReadOnlyDictionary<Point, TextureRegion> textures, Point textureRegion, bool allowsWallpaper, TextureRegion icon, ColorSettings colors)
Parameters
namestringThe name of this stairs type.
priceintThe price of this stairs type.
texturesIReadOnlyDictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegionPointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
allowsWallpaperboolWhether this stairs type supports applying wallpaper.
iconTextureRegionThe icon for this stairs type.
colorsColorSettingsThe color schemes for each layer of this stairs type.
StairsType(string, int, IReadOnlyDictionary<Point, TextureRegion>, Point, bool, params ColorScheme[])
Creates a new stairs type with the given settings.
public StairsType(string name, int price, IReadOnlyDictionary<Point, TextureRegion> textures, Point textureRegion, bool hasWallpaper, params ColorScheme[] colorSchemes)
Parameters
namestringThe name of this stairs type.
priceintThe price of this stairs type.
texturesIReadOnlyDictionary<Point, TextureRegion>The texture atlas that this stairs type's <see cref="TextureRegion"/> is on.
textureRegionPointThe texture region of this stairs type on the <see cref="Textures"/> texture atlas.
hasWallpaperboolWhether this stairs type supports applying wallpaper.
colorSchemesColorScheme[]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 IReadOnlyDictionary<Point, TextureRegion> Textures
Field Value
- IReadOnlyDictionary<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
timeGameTimeThe game time.
batchSpriteBatchThe sprite batch to use for drawing.
mapMapThe map to use as a basis for column-based drawing.
positionPointThe world position to use for drawing.
floorintThe floor to use for drawing.
drawPosVector2The draw position, or screen position, to use for drawing.
rotationDirection2The rotation, in world space.
visualRotationDirection2The visual rotation, optionally with camera rotation applied.
colorIndicesint[]The color indices to use for each Colors entry.
wallpaperWallpaperThe wallpaper to draw on this stairs type, or null to draw none.
scalefloatThe scale to draw with.
depthOffsetfloatAn optional added depth offset.
overrideColorColor?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
eElementThe element to base scaling and positioning on.
batchSpriteBatchThe sprite batch to use for drawing.
timeGameTimeThe game time.
mapMapThe map to use as a basis for column-based drawing.
colorIndicesint[]The color indices to use for each ColorSettings entry.
wallpaperWallpaperThe wallpaper to draw the stairs with.
drawScalefloatThe scale to draw with.
Register(StairsType)
Registers the given stairs type into the Types registry.
public static StairsType Register(StairsType type)
Parameters
typeStairsTypeThe stairs type to register.
Returns
- StairsType
The registered stairs type, for chaining.