Options
All
  • Public
  • Public/Protected
  • All
Menu

Module view/GameStat

Type aliases

Functions

Object literals

Type aliases

Props

Props: object

React props for GameStat component

Type declaration

  • Optional children?: any

    Value which should be displayed next to the icon

  • Optional className?: undefined | string

    CSS class name for adjusting the component look from outside

  • type: StatType

    Type of the stat

StatType

StatType: keyof typeof Icons

Types of game stats which have their icons defined

Functions

Const GameStat

  • GameStat(__namedParameters: object): Element
  • React Component displaying game stats (skills, resources, etc.) as their icon followed by the value.

    Parameters

    • __namedParameters: object
      • children: any
      • className: undefined | string
      • type: "COMMON" | "UNCOMMON" | "RARE" | "MOVING" | "MINING" | "COMBAT" | "PRODUCT" | "LOCATION" | "TIME"

    Returns Element

Const icoStyle

  • icoStyle(index: number): CSSProperties
  • Helper function for creating the icons from "icons128.png" spritesheet, according to their index

    Parameters

    • index: number

      Order of the given icon in spritesheet

    Returns CSSProperties

Const resourceStyle

  • resourceStyle(row?: number, col?: number): CSSProperties
  • Helper function for creating the icons from "terrain128_eth.png" spritesheet, according to their coordinates

    Parameters

    • Default value row: number = 0

      Row of the icon in spritesheet

    • Default value col: number = 0

      Column of the icon in spritesheet

    Returns CSSProperties

Object literals

Const Icons

Icons: object

Game stat icons, ready for inserting into the common HTML text

COMBAT

COMBAT: Element = <span style={icoStyle(2)} />

COMMON

COMMON: Element = <span style={resourceStyle(0)} />

LOCATION

LOCATION: Element = <span style={icoStyle(3)} />

MINING

MINING: Element = <span style={icoStyle(1)} />

MOVING

MOVING: Element = <span style={icoStyle(0)} />

PRODUCT

PRODUCT: Element = <span style={resourceStyle(7,1)} />

RARE

RARE: Element = <span style={resourceStyle(2)} />

TIME

TIME: Element = <span style={icoStyle(4)} />

UNCOMMON

UNCOMMON: Element = <span style={resourceStyle(1)} />

Const baseStyle

baseStyle: object

Base CSS style for stat icons

display

display: string = "inline-block"

height

height: string = "1rem"

verticalAlign

verticalAlign: string = "top"

width

width: string = "1rem"

Generated using TypeDoc