Elin Decompiled Documentation EA 23.250 Nightly Patch 1
Loading...
Searching...
No Matches
BiomeProfile Class Reference
Inheritance diagram for BiomeProfile:
EScriptable

Classes

class  BaseTile
 
class  Cluster
 
class  ClusterObj
 
class  Clusters
 
class  ClusterThing
 
class  SpawnList
 
class  SpawnListChara
 
class  SpawnListThing
 
class  Spawns
 
class  Style
 
class  Tile
 
class  TileBlock
 
class  TileFloor
 
class  TileGroup
 

Public Types

enum  DoorStyle {
  simpleWood , FirmWood , Stone , Jail ,
  Rune
}
 
enum  StairsStyle { Soil , Wood , Stone , Rock }
 

Public Member Functions

void Populate (Point point, bool interior=false, float mtpDensity=1f)
 
void Reset ()
 

Static Public Member Functions

static void Init ()
 
- Static Public Member Functions inherited from EScriptable
static int rnd (int a)
 

Public Attributes

NoiseLayer layerBlock
 
BiomeID id
 
Color color
 
FowProfile fowProfile
 
TileGroup _exterior
 
TileGroup _interior
 
Style style
 
Spawns spawn
 
Clusters cluster
 
string tags
 
int floor_height
 

Static Public Attributes

static bool forceInitialize
 

Properties

TileGroup exterior [get]
 
TileGroup interior [get]
 
SourceMaterial.Row MatFloor [get]
 
SourceMaterial.Row MatSub [get]
 

Private Attributes

SourceMaterial.Row _mat
 
SourceMaterial.Row _matSub
 

Detailed Description

Definition at line 7 of file BiomeProfile.cs.

Member Enumeration Documentation

◆ DoorStyle

Enumerator
simpleWood 
FirmWood 
Stone 
Jail 
Rune 

Definition at line 9 of file BiomeProfile.cs.

◆ StairsStyle

Enumerator
Soil 
Wood 
Stone 
Rock 

Definition at line 18 of file BiomeProfile.cs.

Member Function Documentation

◆ Init()

static void BiomeProfile.Init ( )
inlinestatic

Definition at line 781 of file BiomeProfile.cs.

782 {
783 if (!forceInitialize)
784 {
785 return;
786 }
787 Debug.Log("Initializing Clusters");
788 foreach (BiomeProfile value in EClass.core.refs.biomes.dict.Values)
789 {
790 value.Reset();
791 }
792 forceInitialize = false;
793 }
static bool forceInitialize
UD_Biome dict
Definition: CoreRef.cs:146
Biomes biomes
Definition: CoreRef.cs:341
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
ICollection< TValue > Values
Definition: UDictionary.cs:29

References CoreRef.biomes, EClass.core, Debug, CoreRef.Biomes.dict, forceInitialize, Core.refs, Reset(), and UDictionary< TKey, TValue >.Values.

Referenced by BaseMapGen.Generate().

◆ Populate()

void BiomeProfile.Populate ( Point  point,
bool  interior = false,
float  mtpDensity = 1f 
)
inline

Definition at line 716 of file BiomeProfile.cs.

717 {
718 Cell cell = point.cell;
719 if (cell.obj != 0 || cell.Things.Count > 0)
720 {
721 return;
722 }
723 int count = this.cluster.obj.Count;
724 for (int i = 0; i < count + this.cluster.thing.Count; i++)
725 {
726 Cluster cluster = ((i >= count) ? ((Cluster)this.cluster.thing[i - count]) : ((Cluster)this.cluster.obj[i]));
727 if (cluster.density == 0f)
728 {
729 break;
730 }
731 if (Rand.Range(0f, 1f) > cluster.density * mtpDensity)
732 {
733 continue;
734 }
735 switch (cluster.type)
736 {
737 case Cluster.Type.ScatterExterior:
738 if (interior)
739 {
740 continue;
741 }
742 break;
743 case Cluster.Type.ScatterInterior:
744 if (!interior)
745 {
746 continue;
747 }
748 break;
749 case Cluster.Type.ScatterNonObstacle:
750 if ((cell.Left.HasObstacle() ? 1 : 0) + (cell.Right.HasObstacle() ? 1 : 0) + (cell.Front.HasObstacle() ? 1 : 0) + (cell.Back.HasObstacle() ? 1 : 0) > 0)
751 {
752 continue;
753 }
754 break;
755 case Cluster.Type.ByWall:
756 if (cell.Left.hasDoor || cell.Right.hasDoor || cell.Front.hasDoor || cell.Back.hasDoor || (!cell.Left.HasBlock && !cell.Right.HasBlock && !cell.Front.HasBlock && !cell.Back.HasBlock))
757 {
758 continue;
759 }
760 break;
761 case Cluster.Type.ByWallFace:
762 if (cell.Left.hasDoor || cell.Right.hasDoor || cell.Front.hasDoor || cell.Back.hasDoor || (!cell.Left.HasBlock && !cell.Back.HasBlock))
763 {
764 continue;
765 }
766 break;
767 case Cluster.Type.SpaceByWall:
768 if (cell.Left.hasDoor || cell.Right.hasDoor || cell.Front.hasDoor || cell.Back.hasDoor || (!cell.Left.HasBlock && !cell.Right.HasBlock && !cell.Front.HasBlock && !cell.Back.HasBlock) || !interior)
769 {
770 continue;
771 }
772 break;
773 }
774 if (cluster.TryCreate(point))
775 {
776 break;
777 }
778 }
779 }
List< ClusterObj > obj
List< ClusterThing > thing
TileGroup interior
Clusters cluster
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:643
Cell Back
Definition: Cell.cs:153
Cell Front
Definition: Cell.cs:129
List< Thing > Things
Definition: Cell.cs:986
bool HasObstacle()
Definition: Cell.cs:1134
Cell Left
Definition: Cell.cs:165
byte obj
Definition: Cell.cs:38
Cell Right
Definition: Cell.cs:141
bool hasDoor
Definition: Cell.cs:258
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42

References Cell.Back, Point.cell, cluster, Cell.Front, Cell.HasBlock, Cell.hasDoor, Cell.HasObstacle(), interior, Cell.Left, BiomeProfile.Clusters.obj, Cell.obj, Rand.Range(), Cell.Right, BiomeProfile.Clusters.thing, and Cell.Things.

Referenced by Crawler.Crawl(), MapGenDungen.OnGenerateTerrain(), GenRoom.Populate(), MapGen.Populate(), and TraitSpotBiome.Update().

◆ Reset()

void BiomeProfile.Reset ( )
inline

Definition at line 795 of file BiomeProfile.cs.

796 {
797 _mat = null;
798 _matSub = null;
799 }
SourceMaterial.Row _mat
SourceMaterial.Row _matSub

References _mat, and _matSub.

Referenced by Init().

Member Data Documentation

◆ _exterior

TileGroup BiomeProfile._exterior

Definition at line 678 of file BiomeProfile.cs.

◆ _interior

TileGroup BiomeProfile._interior

Definition at line 680 of file BiomeProfile.cs.

◆ _mat

SourceMaterial.Row BiomeProfile._mat
private

Definition at line 693 of file BiomeProfile.cs.

Referenced by Reset().

◆ _matSub

SourceMaterial.Row BiomeProfile._matSub
private

Definition at line 696 of file BiomeProfile.cs.

Referenced by Reset().

◆ cluster

Clusters BiomeProfile.cluster

Definition at line 686 of file BiomeProfile.cs.

Referenced by Populate().

◆ color

Color BiomeProfile.color

Definition at line 674 of file BiomeProfile.cs.

◆ floor_height

int BiomeProfile.floor_height

Definition at line 690 of file BiomeProfile.cs.

Referenced by MapGen.OnGenerateTerrain().

◆ forceInitialize

bool BiomeProfile.forceInitialize
static

Definition at line 668 of file BiomeProfile.cs.

Referenced by Init().

◆ fowProfile

FowProfile BiomeProfile.fowProfile

Definition at line 676 of file BiomeProfile.cs.

Referenced by BaseGameScreen.UpdateShaders().

◆ id

BiomeID BiomeProfile.id

Definition at line 672 of file BiomeProfile.cs.

Referenced by Critter.Create().

◆ layerBlock

NoiseLayer BiomeProfile.layerBlock

Definition at line 670 of file BiomeProfile.cs.

Referenced by MapGen.OnGenerateTerrain().

◆ spawn

Spawns BiomeProfile.spawn

Definition at line 684 of file BiomeProfile.cs.

Referenced by Region.OnAdvanceHour(), and SerializedCards.Restore().

◆ style

◆ tags

string BiomeProfile.tags

Definition at line 688 of file BiomeProfile.cs.

Referenced by GenBounds.TryAddMapPiece().

Property Documentation

◆ exterior

TileGroup BiomeProfile.exterior
get

◆ interior

TileGroup BiomeProfile.interior
get

Definition at line 700 of file BiomeProfile.cs.

701 {
702 get
703 {
704 if (_interior.floor.id != 0)
705 {
706 return _interior;
707 }
708 return exterior;
709 }
710 }
TileGroup exterior
TileGroup _interior

Referenced by PartialMap.Apply(), ZonePreEnterDigStairs.Execute(), and Populate().

◆ MatFloor

SourceMaterial.Row BiomeProfile.MatFloor
get

Definition at line 712 of file BiomeProfile.cs.

Referenced by MapGen.OnGenerateTerrain().

◆ MatSub

SourceMaterial.Row BiomeProfile.MatSub
get

Definition at line 714 of file BiomeProfile.cs.


The documentation for this class was generated from the following file: