Wildlife & Farming

Trees

Access every tree found across Dinkum's biomes, including the seed or foragable each grows from and their regrowth timing.


Type

Tree

FieldTypeDescription
idstringStable identifier
namestringDisplay name
imgstringPath to the tree's icon, relative to images/
seedSeed | Foragable?The seed or foragable this tree grows from, if any
itemsDroppedResource[]Items harvested from the tree
locationsBiome[]?Biomes the tree is found in
growthPeriodnumber?Days to reach maturity
regrowthnumber?Days between harvests once mature

Resource is { name: string; img: string; count: number }. See TypeScript integration for the shared type.


Factory

import { trees } from 'dinkum-data'

trees() // all 18 trees
trees(source) // wrap a pre-filtered array

Filters

MethodSignatureDescription
byLocationbyLocation(biome: Biome)Filter to trees found in the given biome. Trees with no locations never match.
import { trees } from 'dinkum-data'

trees().byLocation('Pine Forests').get()

Sorts

MethodSignatureDefaultDescription
sortByGrowthPeriodsortByGrowthPeriod(order?: 'asc' | 'desc')'asc'Sort by growth period in days. Trees without a growthPeriod sort as 0.

Terminal methods

MethodReturnsDescription
.get()Tree[]All results
.first()Tree | undefinedFirst result
.find(id)Tree | undefinedFind by id
.findByName(name)Tree | undefinedCase-insensitive exact name match
.search(query)Tree[]Case-insensitive partial name match
.count()numberNumber of results

Examples

import { trees } from 'dinkum-data'

// Every tree in Pine Forests, fastest growing first
trees().byLocation('Pine Forests').sortByGrowthPeriod().get()

// Look up by name
trees().findByName('Apple Tree')

Next steps

Previous
Foragables