HubGoals
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
|
|
| public static |
getSchema(): {"level": *, "storedShapes": *, "upgradeLevels": *} |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(root: GameRoot) |
|
Member Summary
| Public Members | ||
| public |
currentGoal: {"definition": *, "required": *, "reward": *, "throughputOnly": *} |
|
| public |
Which story rewards we already gained |
|
| public |
level: * |
|
| public |
root: * |
|
| public |
Mapping from shape hash -> amount |
|
| public |
Stores the improvements for all upgrades |
|
| public |
Stores the levels for all upgrades |
|
Method Summary
| Public Methods | ||
| public |
canUnlockUpgrade(upgradeId: string): boolean Returns whether a given upgrade can be unlocked |
|
| public |
computeFreeplayShape(level: number): ShapeDefinition Creates a (seeded) random shape |
|
| public |
Creates the next goal |
|
| public |
deserialize(data: *, root: GameRoot): * |
|
| public |
Picks random colors which are close to each other |
|
| public |
Returns the number of available upgrades |
|
| public |
Belt speed |
|
| public |
Returns how much of the current goal was already delivered |
|
| public |
Miner speed |
|
| public |
getProcessorBaseSpeed(processorType: enumItemProcessorTypes): number Processor speed |
|
| public |
getShapesStored(definition: ShapeDefinition): number Returns how much of the current shape is stored |
|
| public |
getShapesStoredByKey(key: string): number Returns how much of the current shape is stored |
|
| public |
Underground belt speed |
|
| public |
getUpgradeLevel(upgradeId: string): * Returns the current level of a given upgrade |
|
| public |
handleDefinitionDelivered(definition: ShapeDefinition) Handles the given definition, by either accounting it towards the goal or otherwise granting some points |
|
| public |
Returns whether the end of the demo is reached |
|
| public |
isFreePlay(): * Returns whether we are playing in free-play |
|
| public |
isRewardUnlocked(reward: enumHubGoalRewards): * Returns whether the given reward is already unlocked |
|
| public |
Called when the level was completed |
|
| public |
takeShapeByKey(key: string, amount: number) |
|
| public |
tryUnlockUpgrade(upgradeId: string): boolean Tries to unlock the given upgrade |
|
Inherited Summary
| From class BasicSerializableObject | ||
| public static |
|
|
| public static |
getId() |
|
| public static |
Should return the serialization schema |
|
| public static |
|
|
| public |
deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void |
|
| public |
|
|
Static Public Methods
public static getSchema(): {"level": *, "storedShapes": *, "upgradeLevels": *} source
Should return the serialization schema
Override:
BasicSerializableObject#getSchemaReturn:
| {"level": *, "storedShapes": *, "upgradeLevels": *} |
Public Constructors
public constructor(root: GameRoot) source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
BasicSerializableObject#constructorParams:
| Name | Type | Attribute | Description |
| root | GameRoot |
Public Members
public currentGoal: {"definition": *, "required": *, "reward": *, "throughputOnly": *} source
public level: * source
public root: * source
Public Methods
public canUnlockUpgrade(upgradeId: string): boolean source
Returns whether a given upgrade can be unlocked
Params:
| Name | Type | Attribute | Description |
| upgradeId | string |
public computeFreeplayShape(level: number): ShapeDefinition source
Creates a (seeded) random shape
Params:
| Name | Type | Attribute | Description |
| level | number |
public deserialize(data: *, root: GameRoot): * source
Override:
BasicSerializableObject#deserializeParams:
| Name | Type | Attribute | Description |
| data | * | ||
| root | GameRoot |
Return:
| * |
public generateRandomColorSet(rng: RandomNumberGenerator): * source
Picks random colors which are close to each other
Params:
| Name | Type | Attribute | Description |
| rng | RandomNumberGenerator |
Return:
| * |
public getCurrentGoalDelivered(): * source
Returns how much of the current goal was already delivered
Return:
| * |
public getProcessorBaseSpeed(processorType: enumItemProcessorTypes): number source
Processor speed
Params:
| Name | Type | Attribute | Description |
| processorType | enumItemProcessorTypes |
public getShapesStored(definition: ShapeDefinition): number source
Returns how much of the current shape is stored
Params:
| Name | Type | Attribute | Description |
| definition | ShapeDefinition |
public getShapesStoredByKey(key: string): number source
Returns how much of the current shape is stored
Params:
| Name | Type | Attribute | Description |
| key | string |
public getUpgradeLevel(upgradeId: string): * source
Returns the current level of a given upgrade
Params:
| Name | Type | Attribute | Description |
| upgradeId | string |
Return:
| * |
public handleDefinitionDelivered(definition: ShapeDefinition) source
Handles the given definition, by either accounting it towards the goal or otherwise granting some points
Params:
| Name | Type | Attribute | Description |
| definition | ShapeDefinition |
public isRewardUnlocked(reward: enumHubGoalRewards): * source
Returns whether the given reward is already unlocked
Params:
| Name | Type | Attribute | Description |
| reward | enumHubGoalRewards |
Return:
| * |
