Class: Building

mmm. Building

new Building(colony, id, name, description, designation, price_common, price_rare, rate_common, rate_rare, unique)

Represents a building for purchase
Parameters:
Name Type Description
colony mmm.Colony The parent colony
id string ID of the building
name string Name of the building
description string Description of the building
designation string Designation which when unlocked, unlocks the building
price_common number | function Number or function returning the price in common ore
price_rare number | function Number or function returning the price in rare ore
rate_common number | function Number or function returning the production rate in common ore
rate_rare number | function Number or function returning the production rate in rare ore
unique boolean Whether or not there can only be at most one of the building
Source:

Extends

Members

affordable :boolean

Whether or not an item can be purchased because enough ore is in storage to afford the price
Type:
  • boolean
Inherited From:
Source:

available :boolean

Whether or not an item can be purchased because it is unique and already purchased
Type:
  • boolean
Inherited From:
Source:

colony :mmm.Colony

Parent colony
Type:
Inherited From:
Source:

count :number

Current number of this unit already purchased
Type:
  • number
Inherited From:
Source:

description :string

Description of the item
Type:
  • string
Inherited From:
Source:

designation :string

Designation which when unlocked, unlocks the item
Type:
  • string
Inherited From:
Source:

id :string

ID of the item
Type:
  • string
Inherited From:
Source:

is_upgrade :boolean

Whether or not the item is an upgrade
Type:
  • boolean
Inherited From:
Source:

name :string

Name of the item
Type:
  • string
Inherited From:
Source:

purchasable :boolean

Whether or not an item can be purchased because it unlocked, affordable and available
Type:
  • boolean
Inherited From:
Source:

purchased :boolean

Whether or not an item has already been purchased
Type:
  • boolean
Inherited From:
Source:

rate_common_gain :number

Rate of item common ore production over total colony common ore production
Type:
  • number
Inherited From:
Source:

rate_rare_gain :number

Rate of item rare ore production over total colony rare ore production
Type:
  • number
Inherited From:
Source:

recyclable :boolean

Whether or not the item can be recycled (sold)
Type:
  • boolean
Inherited From:
Source:

show_details

Inherited From:
Source:

time_each :number

Seconds each item costs when the user is clicking
Type:
  • number
Inherited From:
Source:

time_each_click :number

Seconds each item costs when the user is clicking
Type:
  • number
Inherited From:
Source:

time_next :number

Seconds until item is affordable when the user is not clicking
Type:
  • number
Inherited From:
Source:

time_next_click :number

Seconds until item is affordable when the user is clicking
Type:
  • number
Inherited From:
Source:

unique :boolean

Whether or not there can only be one of this item
Type:
  • boolean
Inherited From:
Source:

unlocked :boolean

Whether or not an item can be purchased because it's designation has been unlocked
Type:
  • boolean
Inherited From:
Source:

Methods

purchase()

Purchases the item, paying the purchase price
Inherited From:
Source:

purchaseComplete()

Increases unit price when purchase was successful
Source:

recycle()

Recycles the item, refunding some of the purchase price
Inherited From:
Source:

recycleComplete()

Does nothing when recycle was successful
Source:

use(turns)

Uses building over the elapsed seconds
Parameters:
Name Type Description
turns number Number of seconds to calculate
Source: