Skip to content

Class Company

Represents a Player Company

Namespace: VoxelTycoon

Constructors

Company()

Creates new company with default values.

Declaration

public Company()

Company(StateBinaryReader)

Creates new company from provided binary reader.

Declaration

public Company(StateBinaryReader reader)
Type Name Description
StateBinaryReader reader Reader with company values

Properties

Cheater

Whether the player company has used cheats.

Declaration

public bool Cheater { get; set; }
Type Description
bool True if cheats were used

Color

The company's color. Changing it will invoke the ColorChanged action.

Declaration

public Color Color { get; set; }
Type Description
Color Company color

ContrastColor

Get's color that's a contract to a company's color.

Declaration

public Color ContrastColor { get; }
Type Description
Color Contrasting color

Current

Get's current company used in the game.

Declaration

public static Company Current { get; }
Type Description
Company Current company

CurrentBudgetPeriod

Gets company's current budget period.

Declaration

public BudgetPeriod CurrentBudgetPeriod { get; private set; }
Type Description
BudgetPeriod Company's budget period

Headquarters

Company's headquarters building.

Declaration

public Headquarters Headquarters { get; internal set; }
Type Description
Headquarters Company's headquarters, probably null if not built

HeadquartersFlag

Probably indicates whether headquarters were built.

Declaration

public bool HeadquartersFlag { get; set; }
Type Description
bool Whether headquarters are built (?)

Id

Company Id.

Declaration

public byte Id { get; set; }
Type Description
byte Company's internal Id

Loan

Company's current loan.

Declaration

public double Loan { get; }
Type Description
double Loan

LoanCount

Amount of loans currently taken.

Declaration

public int LoanCount { get; private set; }
Type Description
int Amount of loans

LoanInterest

Current loan interest.

Declaration

public double LoanInterest { get; private set; }
Type Description
double Loan interest

LoanStep

How much loan increases each time it's taken.

Declaration

public double LoanStep { get; private set; }
Type Description
double Amount of money received when taking a loan

MaxLoan

Maximum loan company can take.

Declaration

public double MaxLoan { get; }
Type Description
double Max loan amount

MaxLoanCount

Maximum amount of times company can take a loan.

Declaration

public int MaxLoanCount { get; }
Type Description
int How much loans can company take

Money

How much money a company has.

Declaration

public double Money { get; private set; }
Type Description
double Amount of money

Name

Company name. Changing it will invoke the NameChanged action.

Declaration

public string Name { get; set; }
Type Description
string Company name

PreviousBudgetPeriod

Company's previous budget period.

Declaration

public BudgetPeriod PreviousBudgetPeriod { get; private set; }
Type Description
BudgetPeriod Previous budget period

Value

Company's value.

Declaration

public double Value { get; private set; }
Type Description
double Company value

Events

ColorChanged

Action on when company color changes.

Declaration

public event Action ColorChanged;
Type Description
Action ColorChanged event action

MoneyChanged

Action on when company money changes.

Declaration

public event Action MoneyChanged;
Type Description
Action MoneyChanged event action

NameChanged

Action on when company name changes.

Declaration

public event Action NameChanged;
Type Description
Action NameChanged event action

Methods

AddMoney(double, BudgetItem, bool)

Adds money to the company.

If value is negative takes money away from the company.

Declaration

public void AddMoney(double value, BudgetItem budgetItem, bool important = true)

Parameters

Type Name Description
double value How much money to add
BudgetItem budgetItem Category of the income
bool important (?)

AddRunningCosts(double, BudgetItem)

Adds running costs to the specified category.

Declaration

public void AddRunningCosts(double value, BudgetItem budgetItem)

Parameters

Type Name Description
double value How much money to add to the running costs
BudgetItem budgetItem Category of the costs

Borrow(int)

Takes a loan.

Declaration

public void Borrow(int count)

Parameters

Type Name Description
int count Amount of loans to take

CanBorrow(int)

Gets whether the company can take a loan.

Declaration

public bool CanBorrow(int count)

Parameters

Type Name Description
int count How many loans company wants to take

Returns

Type Description
bool Whether the company can take that much loans

CanRepay(int)

Gets whether the company can take a loan.

Declaration

public bool CanRepay(int count)

Parameters

Type Name Description
int count How many loans company wants to return

Returns

Type Description
bool Whether the company can repay that much loans

HasEnoughMoney(double)

Gets whether the company can afford something.

Declaration

public bool HasEnoughMoney(double price)

Parameters

Type Name Description
double price How much company wants to spend

Returns

Type Description
bool Whether the company can spend that much money

InitializeLoan(int, int, double, double)

Initializes loans for company.

Declaration

public void InitializeLoan(int loanCount, int extraLoanCount, double loanStep, double loanInterest)

Parameters

Type Name Description
int loanCount Amount of loans
int extraLoanCount Additional available loans
double loanStep Money given/taken each step
double loanInterest Interest of the loan

Repay(int)

Repays loans.

Declaration

public void Repay(int count)

Parameters

Type Name Description
int count Amount of loans to repay