Skip to content

Class Region

Represents a region

Namespace: VoxelTycoon

Constructors

Region(int, Xz, Xz, Xz, int, int)

Creates a new region.

Declaration

public Region(int id, Xz minIndex, Xz maxIndex, Xz center, int tier, int subregionSize)
Type Name Description
int id Region's ID
Xz minIndex Minimum index
Xz maxIndex Maximum index
Xz center Center of the region
int tier Tier of the region
int subregionSize Size of the region

Region(StateBinaryReader)

Creates a new region from provided binary reader.

Declaration

public Region(StateBinaryReader reader)
Type Name Description
StateBinaryReader reader Reader with region values

Properties

Area

Represents the region's area.

Declaration

public HashSet<Xz> Area { get; }
Type Description
HashSet<Xz> List of Xzs included in the region

Biome

Region's biome.

Declaration

public Biome Biome { get; }
Type Description
Biome Region's biome

Center

Region's center.

Declaration

public Xz Center { get; }
Type Description
Xz Coordinates(Xz) of the region's center

Cities

Region's cities.

Declaration

public ImmutableList<Cities.City> Cities { get; }
Type Description
ImmutableList<City> List of the region's cities

ColliderPath

Region's collider path.

Declaration

public Vector2[] ColliderPath { get; }
Type Description
Vector2[] List of 2D vectors representing the path

Deposits

Region's deposits.

Declaration

public ImmutableList<Deposit> Deposits { get; }
Type Description
ImmutableList<Deposit> List of the region's deposits

Id

Region's ID.

Declaration

public int Id { get; }
Type Description
int Region's ID

MaxIndex

Region's max index.

Declaration

public Xz MaxIndex { get; }
Type Description
Xz Region's max index

MinIndex

Region's min index.

Declaration

public Xz MinIndex { get; }
Type Description
Xz Region's min index

Name

Region's name.

Declaration

public string Name { get; set; }
Type Description
string Region's name

Price

Region's price.

Declaration

public double Price { get; }
Type Description
double Region's price

State

Current state of the region.

Declaration

public RegionState State { get; }
Type Description
RegionState Region's state

Subregions

Sub regions of the region.

Declaration

public List<Xz> Subregions { get; }
Type Description
List<Xz> List of the sub regions

Tier

Region's tier.

Declaration

public int Tier { get; }
Type Description
int Region's tier

Methods

GetDistance(Xz)

Gets the distance beween ?.

Declaration

public int GetDistance(Xz regionIndex)

Parameters

Type Name Description
int regionIndex ?

InvalidateBorderOpacity()

Invalidates the region's border opacity.

Declaration

public void InvalidateBorderOpacity()

InvalidateBorderVisibility()

Invalidates the region's border visibility.

Declaration

public void InvalidateBorderVisibility()

OnDrawGizmos()

Probably called when gizmos is drawn.

Declaration

public void OnDrawGizmos()

RegisterDeposit(Deposit)

Registers a deposit in the region.

Declaration

public void RegisterDeposit(Deposit deposit)

Parameters

Type Name Description
Deposit deposit Deposit to register

SetState(RegionState)

Sets the region's state.

Declaration

public void SetState(RegionState state)

Parameters

Type Name Description
RegionState state Region state to be set on the region

UnregisterDeposit(Deposit)

Unregisters a deposit in the region.

Declaration

public void UnregisterDeposit(Deposit deposit)

Parameters

Type Name Description
Deposit deposit Deposit to unregister

Write(StateBinaryWriter)

Probably writes the region's values.

Declaration

public void Write(StateBinaryWriter writer)
Type Name Description
StateBinaryWriter writer Writer with region values

Last update: September 1, 2021