Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IResource

IPlayer is associated with resources. Each player can have different list of resource definitions IUnit are associated with resources also since the predicate buildCondition is based on the resources the player has (in part). For example, I need 50 gold in order to build a soldier. IResource.value.

IResource.value can only be modified at the following moments:

  • when the turn ends : we sum all events that give net gold that happened in the turn (like enemy unit kills, gold per turn, etc),* , and then multiply it with possible factors (like bank before)
  • when user build/buy something. we cannot wait til the end of the turn - we must subtract money in that exact moment when the unit/building is created.

Hierarchy

Index

Properties

Optional custom

custom: any

so users can include additional information. They implement almost everything and probably can put more data for easy edition

defaultValuePerTurn

defaultValuePerTurn: number

by default a resource will increase something per turn without having to happen anything...

Optional description

description: string

icon

icon: string

Optional id

id: string

Optional name

name: string

thisTurnValue

thisTurnValue: number

the cumulative resource value for this turn. When the turn ends, thisTurnValue is summed to value and reseted to 0

Optional timestamp

timestamp: number

value

value: number

Current player's value - when he buy something the resources are extracted from this value

Generated using TypeDoc