kotcity4 / kotcity.data / HasConcreteInventory

HasConcreteInventory

interface HasConcreteInventory : HasInventory

This is used for something in the CityMap that has REAL trackable inventory. The reason we have "HasConcreteInventory" and not is because the outside NationalTradeEntity does not REALLY have anything. It just pretends to.

Properties

inventory

abstract val inventory: Inventory

Functions

addInventory

open fun addInventory(tradeable: Tradeable, quantity: Int): Int

balance

open fun balance(): Int

How much Tradeable.MONEY that the given thing has.

quantityOnHand

open fun quantityOnHand(tradeable: Tradeable): Int

setInventory

open fun setInventory(tradeable: Tradeable, quantity: Int): Int

subtractInventory

open fun subtractInventory(tradeable: Tradeable, quantity: Int): Int

summarizeInventory

open fun summarizeInventory(): String

Used to print a textual description of the Tradeables that this thing has.

transferInventory

open fun transferInventory(to: TradeEntity, tradeable: Tradeable, quantity: Int): Int

Send Tradeable to another TradeEntity but only if we actually have it

Inheritors

Building

abstract class Building : HasConcreteInventory, HasConcreteContacts

The basic unit of simulation in this game. Represents a building and all its attributes. We currently count Road as building as well as PowerLine.