Elin Decompiled Documentation EA 23.347 Nightly
Loading...
Searching...
No Matches
Cell Class Reference
Inheritance diagram for Cell:
Algorithms.WeightCell

Public Member Functions

override bool Equals (object obj)
 
override string ToString ()
 
override int GetHashCode ()
 
Point GetPoint ()
 
Point GetSharedPoint ()
 
bool CanSuffocate ()
 
bool HasObstacle ()
 
bool CanBuildRamp (int dir)
 
void Refresh ()
 
void RotateBlock (int a)
 
void RotateFloor (int a)
 
void RotateObj (bool reverse=false, bool useBlockDir=false)
 
void RotateAll ()
 
void Reset ()
 
CellDetail GetOrCreateDetail ()
 
void TryDespawnDetail ()
 
void AddCard (Card c)
 
void RemoveCard (Card c)
 
string GetBlockName ()
 
string GetFloorName ()
 
string GetBridgeName ()
 
string GetObjName ()
 
string GetLiquidName ()
 
bool CanGrow (SourceObj.Row obj, VirtualDate date)
 
void TryGrow (VirtualDate date=null)
 
bool CanHarvest ()
 
bool CanReapSeed ()
 
bool CanMakeStraw ()
 
PlantData TryGetPlant ()
 
void DyeObj (string id)
 
float GetSurfaceHeight ()
 
bool HasZoneStairs (bool includeLocked=true)
 
override bool IsPathBlocked (IPathfindWalker walker, PathManager.MoveType moveType)
 
virtual bool IsPathBlocked (IPathfindWalker walker, PathManager.MoveType moveType)
 

Public Attributes

int _block
 
int _blockMat
 
int _floor
 
int _floorMat
 
int obj
 
int objMat
 
int _bridge
 
int _bridgeMat
 
int _roofBlock
 
int _roofBlockMat
 
int _deco
 
int _decoMat
 
byte _dirs
 
byte objVal
 
byte decal
 
byte _roofBlockDir
 
int bridgePillar
 
byte x
 
byte z
 
byte light
 
byte autotile
 
byte autotileDeco
 
byte autotileBridge
 
byte autotileObj
 
byte shore
 
byte shadow
 
byte height
 
byte bridgeHeight
 
byte shadowMod
 
byte topHeight
 
byte minHeight
 
byte highlight
 
ushort lightR
 
ushort lightG
 
ushort lightB
 
CellDetail detail
 
CellEffect effect
 
Critter critter
 
BitArray32 bits
 
BitArray32 bits2
 
Room room
 
TraitDoor traitDoor
 
bool pcSync
 
- Public Attributes inherited from Algorithms.WeightCell
bool blocked
 
byte[] weights = new byte[4]
 
byte baseWeight
 

Static Public Attributes

static Map map
 
static Cell Void = new Cell()
 
static List< SourceMaterial.RowmatList
 
static List< SourceBlock.RowblockList
 
static List< SourceFloor.RowfloorList
 
static List< SourceDeco.RowdecoList
 
static List< SourceCellEffect.RoweffectList
 
static List< SourceObj.RowobjList
 
static SourceMaterial matSource
 
static SourceBlock blockSource
 
static SourceFloor floorSource
 
static SourceDeco decoSource
 
static SourceCellEffect effectSource
 
static SourceObj objSource
 
static int Size
 
static Cell[,] cells
 
const int DivAutotile = 12
 
const int DIV_LIQUID = 10
 
const int DivStage = 30
 

Properties

int index [get]
 
byte TopHeight [get]
 
Cell Front [get]
 
Cell Right [get]
 
Cell Back [get]
 
Cell Left [get]
 
Cell FrontRight [get]
 
Cell FrontLeft [get]
 
Cell BackRight [get]
 
Cell BackLeft [get]
 
GrowSystem growth [get]
 
bool isSurrounded [get, set]
 
bool isShadowed [get, set]
 
bool hasDoor [get]
 
bool skipRender [get, set]
 
bool isSeen [get, set]
 
bool isSurrounded4d [get, set]
 
bool isForceFloat [get, set]
 
bool blockSight [get, set]
 
bool isHarvested [get, set]
 
bool isWatered [get, set]
 
bool isSlopeEdge [get, set]
 
bool isBridgeEdge [get, set]
 
bool ignoreObjShadow [get, set]
 
bool nonGradient [get, set]
 
bool impassable [get, set]
 
bool outOfBounds [get, set]
 
bool isWallEdge [get, set]
 
bool isModified [get, set]
 
bool isClearSnow [get, set]
 
bool fullWall [get, set]
 
bool isFloating [get, set]
 
bool lotWall [get, set]
 
bool hasDoorBoat [get, set]
 
bool isDeck [get, set]
 
bool castFloorShadow [get, set]
 
bool lotShade [get, set]
 
bool isShoreSand [get, set]
 
bool isToggleWallPillar [get, set]
 
bool hasWindow [get, set]
 
bool isCurtainClosed [get, set]
 
bool isSkyFloor [get, set]
 
bool isClearArea [get, set]
 
bool isObjDyed [get, set]
 
bool crossWall [get, set]
 
bool hidePillar [get, set]
 
bool toggleOcclusion [get, set]
 
bool HasObj [get]
 
bool HasBlock [get]
 
bool HasFloor [get]
 
bool HasRoof [get]
 
bool HasFloorOrBlock [get]
 
bool HasBridge [get]
 
bool HasLiquid [get]
 
bool HasFire [get]
 
bool IsNotWaterEdge [get]
 
bool IsTopWater [get]
 
bool IsTopWaterAndNoSnow [get]
 
bool IsFloorWater [get]
 
bool IsFarmField [get]
 
bool CanGrowWeed [get]
 
bool IsBridgeWater [get]
 
bool IsSnowTile [get]
 
bool IsDeepWater [get]
 
bool IsIceTile [get]
 
bool HasFullBlock [get]
 
bool HasFullBlockOrWallOrFence [get]
 
bool HasWallOrFence [get]
 
bool HasWall [get]
 
bool HasFence [get]
 
bool HasRamp [get]
 
bool HasLadder [get]
 
bool HasRampOrLadder [get]
 
bool HasSlope [get]
 
bool HasStairs [get]
 
bool HasHalfBlock [get]
 
bool HasBlockOrRamp [get]
 
bool UseLowBlock [get]
 
bool CastShadow [get]
 
bool CastAmbientShadow [get]
 
bool IsRoomEdge [get]
 
bool IsLotEdge [get]
 
bool IsBlocked [get]
 
int blockDir [get, set]
 
int objDir [get, set]
 
int floorDir [get, set]
 
bool IsSky [get]
 
int liquidLv [get]
 
int fireAmount [get]
 
bool IsVoid [get]
 
Thing FirstThing [get]
 
Thing Installed [get]
 
List< ThingThings [get]
 
List< CharaCharas [get]
 
int gatherCount [get, set]
 
bool HasFloodBlock [get]
 
SourceMaterial.Row matRoofBlock [get]
 
SourceMaterial.Row matBlock [get]
 
SourceMaterial.Row matFloor [get]
 
SourceMaterial.Row matDeco [get]
 
SourceMaterial.Row matBridge [get]
 
SourceMaterial.Row matObj [get]
 
SourceMaterial.Row matObj_fixed [get]
 
SourceBlock.Row sourceRoofBlock [get]
 
SourceBlock.Row sourceBlock [get]
 
SourceFloor.Row sourceFloor [get]
 
SourceFloor.Row sourceBridge [get]
 
SourceFloor.Row sourceSurface [get]
 
SourceDeco.Row sourceDeco [get]
 
SourceCellEffect.Row sourceEffect [get]
 
SourceObj.Row sourceObj [get]
 
BiomeProfile biome [get]
 

Static Private Attributes

static bool openSight
 
static bool openPath
 

Detailed Description

Definition at line 6 of file Cell.cs.

Member Function Documentation

◆ AddCard()

void Cell.AddCard ( Card  c)
inline

Definition at line 1622 of file Cell.cs.

1623 {
1625 if (c.isChara)
1626 {
1627 detail.charas.Add(c.Chara);
1628 return;
1629 }
1631 c.Thing.stackOrder = detail.things.Count - 1;
1633 {
1635 }
1636 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
virtual Chara Chara
Definition: Card.cs:2122
Trait trait
Definition: Card.cs:54
virtual bool isChara
Definition: Card.cs:2135
virtual Thing Thing
Definition: Card.cs:2110
virtual CardRow sourceCard
Definition: Card.cs:2183
List< Thing > things
Definition: CellDetail.cs:11
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail GetOrCreateDetail()
Definition: Cell.cs:1605
CellDetail detail
Definition: Cell.cs:112
Point GetPoint()
Definition: Cell.cs:1141
void RefreshNeighborTiles()
Definition: Point.cs:1282
bool multisize
Definition: RenderRow.cs:64
virtual bool ShouldRefreshTile
Definition: Trait.cs:77

References ActPlan.List.Add(), Card.Chara, CellDetail.charas, detail, GetOrCreateDetail(), GetPoint(), Card.isChara, RenderRow.multisize, Point.RefreshNeighborTiles(), Trait.ShouldRefreshTile, Card.sourceCard, Card.Thing, CellDetail.things, and Card.trait.

Referenced by Map._AddCard(), and Card.SetPlaceState().

◆ CanBuildRamp()

bool Cell.CanBuildRamp ( int  dir)
inline

Definition at line 1183 of file Cell.cs.

1184 {
1185 if (HasRamp)
1186 {
1187 return blockDir == dir;
1188 }
1189 return true;
1190 }
bool HasRamp
Definition: Cell.cs:873
int blockDir
Definition: Cell.cs:934

References blockDir, and HasRamp.

Referenced by Map.GetRampDir().

◆ CanGrow()

bool Cell.CanGrow ( SourceObj::Row  obj,
VirtualDate  date 
)
inline

Definition at line 1725 of file Cell.cs.

1726 {
1727 GrowSystem.cell = this;
1728 return obj.growth?.CanGrow(date) ?? false;
1729 }
int obj
Definition: Cell.cs:50

References obj.

Referenced by TraitSeed.TrySprout(), and WidgetDebug.UpdateText().

◆ CanHarvest()

bool Cell.CanHarvest ( )
inline

Definition at line 1736 of file Cell.cs.

1737 {
1738 return growth?.CanHarvest() ?? false;
1739 }
GrowSystem growth
Definition: Cell.cs:247
bool CanHarvest()
Definition: GrowSystem.cs:525

References GrowSystem.CanHarvest(), and growth.

Referenced by Map.GetNearbyResourcePoint(), and TaskHarvest.TryGetAct().

◆ CanMakeStraw()

bool Cell.CanMakeStraw ( )
inline

Definition at line 1746 of file Cell.cs.

1747 {
1748 if (sourceObj.alias == "wheat")
1749 {
1750 return growth.IsLastStage();
1751 }
1752 return false;
1753 }
SourceObj.Row sourceObj
Definition: Cell.cs:1112
bool IsLastStage()
Definition: GrowSystem.cs:119

References growth, GrowSystem.IsLastStage(), and sourceObj.

Referenced by TaskCut.OnProgress(), and TaskCut.OnStart().

◆ CanReapSeed()

bool Cell.CanReapSeed ( )
inline

Definition at line 1741 of file Cell.cs.

1742 {
1743 return growth?.CanReapSeed() ?? false;
1744 }
virtual bool CanReapSeed()
Definition: GrowSystem.cs:534

References GrowSystem.CanReapSeed(), and growth.

Referenced by TaskHarvest.CanProgress(), and TaskHarvest.TryGetAct().

◆ CanSuffocate()

bool Cell.CanSuffocate ( )
inline

Definition at line 1151 of file Cell.cs.

1152 {
1154 {
1155 return true;
1156 }
1157 if (!IsDeepWater)
1158 {
1159 return false;
1160 }
1161 if (detail != null && detail.things.Count > 0)
1162 {
1163 foreach (Thing thing in detail.things)
1164 {
1165 if (thing.IsInstalled && thing.isFloating)
1166 {
1167 return false;
1168 }
1169 }
1170 }
1171 return true;
1172 }
bool isFloating
Definition: Card.cs:653
bool IsInstalled
Definition: Card.cs:2451
bool IsDeepWater
Definition: Cell.cs:830
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:21
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:278
virtual bool IsUnderwater
Definition: Zone.cs:276

References EClass._zone, detail, IsDeepWater, Card.isFloating, Card.IsInstalled, Zone.IsUnderwater, Zone.IsUserZone, and CellDetail.things.

Referenced by Chara._Move(), and ConSuffocation.Tick().

◆ DyeObj()

void Cell.DyeObj ( string  id)
inline

Definition at line 1760 of file Cell.cs.

1761 {
1762 isObjDyed = true;
1763 objMat = EClass.sources.materials.alias[id].id;
1764 }
int objMat
Definition: Cell.cs:52
bool isObjDyed
Definition: Cell.cs:630
static SourceManager sources
Definition: EClass.cs:43
SourceMaterial materials

References isObjDyed, SourceManager.materials, objMat, and EClass.sources.

Referenced by Recipe.Build(), and GrowSystemFlower.OnSetObj().

◆ Equals()

override bool Cell.Equals ( object  obj)
inline

Definition at line 1126 of file Cell.cs.

1127 {
1128 return false;
1129 }

◆ GetBlockName()

string Cell.GetBlockName ( )
inline

Definition at line 1661 of file Cell.cs.

1662 {
1663 return Lang.Parse("blockName", matBlock.GetName(), sourceBlock.GetName());
1664 }
SourceBlock.Row sourceBlock
Definition: Cell.cs:1090
SourceMaterial.Row matBlock
Definition: Cell.cs:1066
Definition: Lang.cs:7
static string Parse(string idLang, string val1, string val2=null, string val3=null, string val4=null, string val5=null)
Definition: Lang.cs:146

References matBlock, Lang.Parse(), and sourceBlock.

Referenced by TaskMine.GetTextSmall(), TaskMine.OnCreateProgress(), LayerInfo.SetBlock(), UICardInfo.SetBlock(), and BlockInfo.WriteNote().

◆ GetBridgeName()

string Cell.GetBridgeName ( )
inline

Definition at line 1671 of file Cell.cs.

1672 {
1673 return Lang.Parse("blockName", matBridge.GetName(), sourceBridge.GetName());
1674 }
SourceMaterial.Row matBridge
Definition: Cell.cs:1072
SourceFloor.Row sourceBridge
Definition: Cell.cs:1094

References matBridge, Lang.Parse(), and sourceBridge.

Referenced by TaskDig.GetTextSmall(), and TaskDig.OnCreateProgress().

◆ GetFloorName()

string Cell.GetFloorName ( )
inline

Definition at line 1666 of file Cell.cs.

1667 {
1668 return Lang.Parse("blockName", matFloor.GetName(), sourceFloor.GetName());
1669 }
SourceFloor.Row sourceFloor
Definition: Cell.cs:1092
SourceMaterial.Row matFloor
Definition: Cell.cs:1068

References matFloor, Lang.Parse(), and sourceFloor.

Referenced by TaskDig.GetTextSmall(), TaskMine.GetTextSmall(), TaskDig.OnCreateProgress(), TaskWater.Run(), LayerInfo.SetFloor(), and UICardInfo.SetFloor().

◆ GetHashCode()

override int Cell.GetHashCode ( )
inline

Definition at line 1136 of file Cell.cs.

1137 {
1138 return index;
1139 }
int index
Definition: Cell.cs:136

References index.

◆ GetLiquidName()

string Cell.GetLiquidName ( )
inline

Definition at line 1720 of file Cell.cs.

1721 {
1722 return Lang.Parse("liquidName", sourceEffect.GetName());
1723 }
SourceCellEffect.Row sourceEffect
Definition: Cell.cs:1110

References Lang.Parse(), and sourceEffect.

Referenced by LayerInfo.SetLiquid(), and UICardInfo.SetLiquid().

◆ GetObjName()

string Cell.GetObjName ( )
inline

Definition at line 1676 of file Cell.cs.

1677 {
1678 PlantData plantData = EClass._map.TryGetPlant(this);
1679 string text = sourceObj.GetName();
1680 if (sourceObj.tag.Contains("mat_name") && matObj.alias != "granite" && (sourceObj.id != 10 || !(matObj.alias == "crystal")))
1681 {
1682 text = "_of2".lang(matObj.GetName(), text);
1683 }
1684 if (plantData != null && plantData.size > 0)
1685 {
1686 text = Lang.GetList("plant_size")[plantData.size - 1] + text;
1687 }
1688 text = text.AddArticle();
1689 if (plantData != null)
1690 {
1691 if (plantData.seed != null)
1692 {
1693 if (!plantData.seed.c_refText.IsEmpty())
1694 {
1695 text = plantData.seed.c_refText;
1696 }
1697 if (plantData.seed.encLV > 0)
1698 {
1699 text = text + "+" + plantData.seed.encLV;
1700 }
1701 }
1702 if (plantData.fert != 0)
1703 {
1704 text += ((plantData.fert > 0) ? "fertilized" : "defertilized").lang();
1705 }
1706 }
1707 if (map.backerObjs.ContainsKey(index))
1708 {
1709 int key = map.backerObjs[index];
1710 SourceBacker.Row row = EClass.sources.backers.map.TryGetValue(key);
1711 if (row != null && EClass.core.config.backer.Show(row))
1712 {
1713 string name = row.Name;
1714 text = ((sourceObj.id == 82) ? "backerRemain".lang(text, name) : "backerTree".lang(text, name));
1715 }
1716 }
1717 return text;
1718 }
string c_refText
Definition: Card.cs:1669
int encLV
Definition: Card.cs:329
SourceMaterial.Row matObj
Definition: Cell.cs:1074
static Map map
Definition: Cell.cs:8
BackerContentConfig backer
Definition: CoreConfig.cs:633
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:7
static Map _map
Definition: EClass.cs:19
static string[] GetList(string id)
Definition: Lang.cs:113
PlantData TryGetPlant(Point p)
Definition: Map.cs:2082
Dictionary< int, int > backerObjs
Definition: Map.cs:70
Thing seed
Definition: PlantData.cs:6
int fert
Definition: PlantData.cs:12
int size
Definition: PlantData.cs:15
SourceBacker backers
string GetName(int id)
Definition: SourceObj.cs:302

References EClass._map, CoreConfig.backer, Map.backerObjs, SourceManager.backers, Card.c_refText, Core.config, EClass.core, Card.encLV, PlantData.fert, Lang.GetList(), SourceObj.GetName(), index, map, matObj, SourceBacker.Row.Name, PlantData.seed, CoreConfig.BackerContentConfig.Show(), PlantData.size, sourceObj, EClass.sources, and Map.TryGetPlant().

Referenced by BaseTaskHarvest.GetTextSmall(), Map.MineObj(), TaskHarvest.OnCreateProgress(), and GrowSystem.PopHarvest().

◆ GetOrCreateDetail()

CellDetail Cell.GetOrCreateDetail ( )
inline

Definition at line 1605 of file Cell.cs.

1606 {
1607 if (detail == null)
1608 {
1610 }
1611 return detail;
1612 }
static CellDetail Spawn()
Definition: CellDetail.cs:25

References detail, and CellDetail.Spawn().

Referenced by AddCard(), Area.AddPoint(), DesignationList< T >.OnAdd(), DesignationList< T >.Remove(), and Map.SetFoormark().

◆ GetPoint()

◆ GetSharedPoint()

Point Cell.GetSharedPoint ( )
inline

Definition at line 1146 of file Cell.cs.

1147 {
1148 return Point.shared.Set(x, z);
1149 }
static Point shared
Definition: Point.cs:20
Point Set(int _x, int _z)
Definition: Point.cs:503

References Point.Set(), Point.shared, x, and z.

Referenced by Map.Burn().

◆ GetSurfaceHeight()

float Cell.GetSurfaceHeight ( )
inline

Definition at line 1766 of file Cell.cs.

1767 {
1768 if (detail == null)
1769 {
1770 return 0f;
1771 }
1772 bool isTopWater = IsTopWater;
1773 for (int i = 0; i < detail.things.Count; i++)
1774 {
1775 Thing thing = detail.things[i];
1776 if (!thing.IsInstalled)
1777 {
1778 continue;
1779 }
1780 if (isTopWater)
1781 {
1782 if (thing.isFloating)
1783 {
1784 return thing.Pref.height + 0.1f;
1785 }
1786 }
1787 else if (thing.Pref.Surface)
1788 {
1789 return 0.1f * (float)thing.altitude + thing.Pref.height;
1790 }
1791 }
1792 return 0f;
1793 }
int altitude
Definition: Card.cs:233
bool IsTopWater
Definition: Cell.cs:736
bool Surface
Definition: SourcePref.cs:369
float height
Definition: SourcePref.cs:53
override SourcePref Pref
Definition: Thing.cs:50

References Card.altitude, detail, SourcePref.height, Card.isFloating, Card.IsInstalled, IsTopWater, Thing.Pref, SourcePref.Surface, and CellDetail.things.

Referenced by Chara._Move().

◆ HasObstacle()

bool Cell.HasObstacle ( )
inline

Definition at line 1174 of file Cell.cs.

1175 {
1176 if (!blocked && _block == 0 && obj == 0)
1177 {
1178 return hasDoor;
1179 }
1180 return true;
1181 }
bool hasDoor
Definition: Cell.cs:279
int _block
Definition: Cell.cs:42

References _block, Algorithms.WeightCell.blocked, hasDoor, and obj.

Referenced by BiomeProfile.Populate().

◆ HasZoneStairs()

bool Cell.HasZoneStairs ( bool  includeLocked = true)
inline

Definition at line 1795 of file Cell.cs.

1796 {
1797 if (detail == null)
1798 {
1799 return false;
1800 }
1801 foreach (Thing thing in detail.things)
1802 {
1803 if (thing.IsInstalled && (thing.trait is TraitStairs || (includeLocked && thing.trait is TraitStairsLocked)))
1804 {
1805 return true;
1806 }
1807 }
1808 return false;
1809 }

References detail, Card.IsInstalled, CellDetail.things, and Card.trait.

Referenced by UIMapPreview._RefreshPoint(), MapBounds.GetRandomSpace(), ActEffect.GetShortTeleportPos(), and ActEffect.GetTeleportPos().

◆ IsPathBlocked()

override bool Cell.IsPathBlocked ( IPathfindWalker  walker,
PathManager::MoveType  moveType 
)
inlinevirtual

Reimplemented from Algorithms.WeightCell.

Definition at line 1811 of file Cell.cs.

1812 {
1813 if (IsSky || outOfBounds)
1814 {
1815 return true;
1816 }
1817 if (moveType == PathManager.MoveType.Default)
1818 {
1819 if (walker.IsAstralBody && !EClass._zone.IsRegion)
1820 {
1821 return false;
1822 }
1823 return blocked;
1824 }
1825 if (!blocked || (walker.IsAstralBody && !EClass._zone.IsRegion))
1826 {
1827 if (detail != null)
1828 {
1829 return detail.charas.Count > 0;
1830 }
1831 return false;
1832 }
1833 return true;
1834 }
bool IsSky
Definition: Cell.cs:970
bool outOfBounds
Definition: Cell.cs:426
virtual bool IsRegion
Definition: Spatial.cs:515

References EClass._zone, Algorithms.WeightCell.blocked, detail, IPathfindWalker.IsAstralBody, Spatial.IsRegion, IsSky, and outOfBounds.

◆ Refresh()

void Cell.Refresh ( )
inline

Definition at line 1192 of file Cell.cs.

1193 {
1194 Cell cell = ((x > 0) ? cells[x - 1, z] : Void);
1195 Cell cell2 = ((x + 1 < Size) ? cells[x + 1, z] : Void);
1196 Cell cell3 = ((z > 0) ? cells[x, z - 1] : Void);
1197 Cell cell4 = ((z + 1 < Size) ? cells[x, z + 1] : Void);
1198 Cell cell5 = ((x > 0 && z > 0) ? cells[x - 1, z - 1] : Void);
1199 Cell cell6 = ((x + 1 < Size && z > 0) ? cells[x + 1, z - 1] : Void);
1200 Cell cell7 = ((x > 0 && z + 1 < Size) ? cells[x - 1, z + 1] : Void);
1201 Cell cell8 = ((x + 1 < Size && z + 1 < Size) ? cells[x + 1, z + 1] : Void);
1202 Cell cell9 = ((z > 1) ? cells[x, z - 2] : Void);
1203 Cell cell10 = ((x + 2 < Size) ? cells[x + 2, z] : Void);
1204 TileType tileType = sourceBlock.tileType;
1205 TileType tileType2 = sourceFloor.tileType;
1206 MapBounds bounds = map.bounds;
1207 bool hasBridge = _bridge != 0;
1208 outOfBounds = x < bounds.x || z < bounds.z || x > bounds.maxX || z > bounds.maxZ;
1209 isSurrounded4d = cell.HasFullBlock && cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock;
1210 isSurrounded = isSurrounded4d && cell5.HasFullBlock && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell3.bridgeHeight == bridgeHeight && cell2.bridgeHeight == bridgeHeight && cell4.bridgeHeight == bridgeHeight && cell.bridgeHeight == bridgeHeight;
1211 traitDoor = null;
1213 hasDoorBoat = false;
1214 isDeck = false;
1215 isShoreSand = false;
1216 hasWindow = false;
1217 isCurtainClosed = false;
1218 isSkyFloor = tileType2 != TileType.Sky && (cell2.sourceFloor.tileType == TileType.Sky || cell3.sourceFloor.tileType == TileType.Sky);
1219 openPath = false;
1220 openSight = tileType.IsOpenSight || (cell3.hasWindow && !cell3.isCurtainClosed) || (cell2.hasWindow && !cell2.isCurtainClosed);
1221 blockSight = tileType.IsBlockSight || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockSight(this) : objSource[obj].tileType.IsBlockSight);
1222 blocked = outOfBounds || tileType.IsBlockPass || (tileType2.IsBlockPass && !hasBridge) || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockPass(this) : objSource[obj].tileType.IsBlockPass) || impassable;
1223 isSlopeEdge = height > cell2.height || height > cell3.height;
1224 if (hasBridge && sourceBridge.tileType.ShowPillar)
1225 {
1226 isBridgeEdge = _bridge != cell2._bridge || _bridge != cell3._bridge || bridgeHeight > cell2.bridgeHeight || bridgeHeight > cell3.bridgeHeight || _bridge != cell._bridge || _bridge != cell4._bridge || bridgeHeight > cell.bridgeHeight || bridgeHeight > cell4.bridgeHeight;
1227 }
1228 else
1229 {
1230 isBridgeEdge = false;
1231 }
1232 lotShade = false;
1233 if (room == null && !EClass._zone.IsSnowCovered)
1234 {
1235 if ((cell10.room != null && cell2.sourceBlock.tileType.CastShadowSelf) || (cell9.room != null && cell3.sourceBlock.tileType.CastShadowSelf))
1236 {
1237 lotShade = true;
1238 }
1239 else if ((cell10.Front.room != null && cell6.sourceBlock.tileType.CastShadowSelf) || (cell9.Right.room != null && cell6.sourceBlock.tileType.CastShadowSelf) || (cell6.FrontRight.room != null && cell6.Right.sourceBlock.tileType.CastShadowSelf))
1240 {
1241 lotShade = true;
1242 }
1243 else if (cell10.sourceBlock.tileType.CastShadowSelf && cell10.Right.room != null)
1244 {
1245 lotShade = true;
1246 }
1247 }
1248 isShadowed = lotShade || sourceBlock.tileType.CastShadowSelf || cell3.sourceBlock.tileType.CastShadowBack || (!HasRoof && _roofBlock != 0);
1249 castFloorShadow = lotShade || (room == null && sourceBlock.tileType.CastShadowSelf);
1250 byte b = (hasBridge ? bridgeHeight : height);
1251 byte b2 = ((cell3.bridgeHeight == 0) ? cell3.height : cell3.bridgeHeight);
1252 byte b3 = ((cell2.bridgeHeight == 0) ? cell2.height : cell2.bridgeHeight);
1253 byte b4 = ((cell9.bridgeHeight == 0) ? cell9.height : cell9.bridgeHeight);
1254 byte b5 = ((cell10.bridgeHeight == 0) ? cell10.height : cell10.bridgeHeight);
1255 int num = 0;
1256 if (b3 - b > num)
1257 {
1258 num = b3 - b;
1259 }
1260 if (b2 - b > num)
1261 {
1262 num = b2 - b;
1263 }
1264 if (b5 - b - 4 > num)
1265 {
1266 num = b5 - b - 4;
1267 }
1268 if (b4 - b - 4 > num)
1269 {
1270 num = b4 - b - 4;
1271 }
1272 num -= 4;
1273 if (num > 15)
1274 {
1275 num = 15;
1276 }
1277 if (IsTopWater)
1278 {
1279 num /= 3;
1280 }
1281 else if (isShadowed)
1282 {
1283 num /= 2;
1284 }
1285 if (num <= 0)
1286 {
1287 num = 0;
1288 }
1289 shadowMod = (byte)num;
1290 baseWeight = 0;
1291 if (detail != null && detail.things.Count > 0)
1292 {
1293 for (int i = 0; i < detail.things.Count; i++)
1294 {
1295 Thing thing = detail.things[i];
1296 if (!thing.IsInstalled)
1297 {
1298 continue;
1299 }
1300 if (thing.trait.WeightMod > baseWeight)
1301 {
1302 baseWeight = thing.trait.WeightMod;
1303 }
1304 if (thing.isHidden)
1305 {
1306 continue;
1307 }
1308 if (thing.trait.IsFloating)
1309 {
1310 isFloating = true;
1311 if (IsFloorWater)
1312 {
1313 blocked = true;
1314 }
1315 else
1316 {
1317 isDeck = true;
1318 }
1319 }
1320 else
1321 {
1322 if (thing.trait.IsOpenPath)
1323 {
1324 blocked = false;
1325 hasDoorBoat = true;
1326 openPath = true;
1327 openSight = true;
1328 }
1329 if (thing.trait.IsBlockPath)
1330 {
1331 blocked = true;
1332 }
1333 }
1334 if (thing.trait.IsOpenSight)
1335 {
1336 openSight = true;
1337 }
1338 if (thing.trait is TraitDoor)
1339 {
1340 traitDoor = thing.trait as TraitDoor;
1341 blocked = false;
1342 blockSight = true;
1343 }
1344 else if (thing.trait.IsBlockSight)
1345 {
1346 blockSight = true;
1347 }
1348 Trait trait = thing.trait;
1349 if (!(trait is TraitWindow))
1350 {
1351 if (trait is TraitCurtain)
1352 {
1353 isCurtainClosed = thing.isOn;
1354 }
1355 }
1356 else
1357 {
1358 hasWindow = true;
1359 }
1360 }
1361 }
1362 minHeight = (byte)(10 + b + ((IsTopWater && !isFloating) ? sourceFloor.tileType.FloorAltitude : 0));
1363 topHeight = (byte)(minHeight + tileType.slopeHeight);
1364 weights[0] = (byte)((Mathf.Abs(cell3.minHeight - topHeight) <= 8 || Mathf.Abs(cell3.topHeight - minHeight) <= 8) ? 1u : 0u);
1365 weights[1] = (byte)((Mathf.Abs(cell2.minHeight - topHeight) <= 8 || Mathf.Abs(cell2.topHeight - minHeight) <= 8) ? 1u : 0u);
1366 weights[2] = (byte)((Mathf.Abs(cell4.minHeight - topHeight) <= 8 || Mathf.Abs(cell4.topHeight - minHeight) <= 8) ? 1u : 0u);
1367 weights[3] = (byte)((Mathf.Abs(cell.minHeight - topHeight) <= 8 || Mathf.Abs(cell.topHeight - minHeight) <= 8) ? 1u : 0u);
1368 if (IsDeepWater)
1369 {
1370 baseWeight += 100;
1371 }
1372 ignoreObjShadow = (b2 > b && b2 - b > 6) || (b3 > b && b3 - b > 6);
1373 isWallEdge = !blocked && cell2.sourceBlock.tileType.IsWallOrFence && cell2.blockDir != 1 && cell3.sourceBlock.tileType.IsWallOrFence && cell3.blockDir != 0;
1374 if (isWallEdge)
1375 {
1376 blockSight = cell2.sourceBlock.tileType.IsBlockSight && cell3.sourceBlock.tileType.IsBlockSight;
1377 blocked = true;
1378 blockSight = true;
1379 }
1380 shadow = 0;
1381 if (!HasBlock)
1382 {
1383 if (cell.isSeen && cell.CastAmbientShadow && !cell.hasDoor && bridgeHeight == cell.bridgeHeight && !sourceFloor.ignoreTransition && (!cell.sourceBlock.tileType.IsWallOrFence || cell.blockDir != 0))
1384 {
1385 shadow++;
1386 }
1387 if (cell4.isSeen && cell4.CastAmbientShadow && !cell4.hasDoor && bridgeHeight == cell4.bridgeHeight && !sourceFloor.ignoreTransition && (!cell4.sourceBlock.tileType.IsWallOrFence || cell4.blockDir != 1))
1388 {
1389 shadow += 2;
1390 }
1391 }
1392 else
1393 {
1394 if (isFloating && (room != null || cell3.room != null || cell2.room != null || cell6.room != null))
1395 {
1396 isFloating = false;
1397 }
1398 if (sourceBlock.tileType.IsFence && !hasDoor && (blockDir != 0 || cell4.topHeight >= b - 3) && (blockDir != 1 || cell.topHeight >= b - 3))
1399 {
1400 shadow = (byte)(blockDir + 4);
1401 }
1402 }
1403 bool isFloorWater = IsFloorWater;
1404 if (isFloorWater)
1405 {
1406 shore = (byte)((((!cell4.IsNotWaterEdge && z != Size - 1 && height == cell4.height) ? 1 : 0) + ((!cell2.IsNotWaterEdge && x != Size - 1 && height == cell2.height) ? 2 : 0) + ((!cell3.IsNotWaterEdge && z != 0 && height == cell3.height) ? 4 : 0) + ((!cell.IsNotWaterEdge && x != 0 && height == cell.height) ? 8 : 0)) * 12);
1407 isShoreSand = cell4.sourceFloor.isBeach || cell2.sourceFloor.isBeach || cell3.sourceFloor.isBeach || cell.sourceFloor.isBeach;
1408 if (shore != 0)
1409 {
1410 shore += (byte)(isShoreSand ? 2 : 3);
1411 }
1412 }
1413 else
1414 {
1415 shore = 0;
1416 }
1417 if (sourceFloor.autotile > 0)
1418 {
1419 autotile = (byte)(((IsAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsAutoTileEdge(cell) && x != 0) ? 8 : 0));
1420 }
1421 else
1422 {
1423 autotile = 0;
1424 }
1425 if (sourceDeco.autotile > 0)
1426 {
1427 autotileDeco = (byte)(((IsDecoAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsDecoAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsDecoAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsDecoAutoTileEdge(cell) && x != 0) ? 8 : 0));
1428 }
1429 else
1430 {
1431 autotileDeco = 0;
1432 }
1433 if (_bridge != 0 && sourceBridge.autotile > 0)
1434 {
1435 autotileBridge = (byte)(((IsBridgeAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsBridgeAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsBridgeAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsBridgeAutoTileEdge(cell) && x != 0) ? 8 : 0));
1436 }
1437 else
1438 {
1439 autotileBridge = 0;
1440 }
1441 if (obj != 0 && sourceObj.autoTile)
1442 {
1443 autotileObj = (byte)(((IsObjAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsObjAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsObjAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsObjAutoTileEdge(cell) && x != 0) ? 8 : 0));
1444 }
1445 else
1446 {
1447 autotileObj = 0;
1448 }
1449 if (openSight)
1450 {
1451 blockSight = false;
1452 }
1453 if (openPath)
1454 {
1455 blocked = false;
1456 }
1457 bool IsAutoTileEdge(Cell cell11)
1458 {
1459 if (!sourceFloor.isBeach && !cell11.sourceFloor.isBeach && (cell11._floor != _floor || cell11._floorMat != _floorMat))
1460 {
1461 return true;
1462 }
1463 if (!isFloorWater)
1464 {
1465 return height != cell11.height;
1466 }
1467 return false;
1468 }
1469 bool IsBridgeAutoTileEdge(Cell cell11)
1470 {
1471 if (cell11._bridge != _bridge || cell11._bridgeMat != _bridgeMat)
1472 {
1473 return true;
1474 }
1475 return bridgeHeight != cell11.bridgeHeight;
1476 }
1477 bool IsDecoAutoTileEdge(Cell cell11)
1478 {
1479 if (cell11._deco != _deco || cell11._decoMat != _decoMat)
1480 {
1481 return true;
1482 }
1483 if (!hasBridge)
1484 {
1485 return topHeight != cell11.topHeight;
1486 }
1487 return bridgeHeight != cell11.bridgeHeight;
1488 }
1489 bool IsObjAutoTileEdge(Cell cell11)
1490 {
1491 if (cell11.obj != obj && (obj != 31 || (cell11.obj != 97 && cell11.obj != 98)))
1492 {
1493 return true;
1494 }
1495 if (!hasBridge)
1496 {
1497 return topHeight != cell11.topHeight;
1498 }
1499 return bridgeHeight != cell11.bridgeHeight;
1500 }
1501 }
bool isHidden
Definition: Card.cs:533
bool isOn
Definition: Card.cs:545
Definition: Cell.cs:7
static Cell[,] cells
Definition: Cell.cs:38
int _bridgeMat
Definition: Cell.cs:56
byte autotileDeco
Definition: Cell.cs:84
Room room
Definition: Cell.cs:122
bool lotShade
Definition: Cell.cs:546
int _floor
Definition: Cell.cs:46
bool castFloorShadow
Definition: Cell.cs:534
byte autotile
Definition: Cell.cs:82
bool HasBlock
Definition: Cell.cs:679
byte shadow
Definition: Cell.cs:92
bool isDeck
Definition: Cell.cs:522
byte shadowMod
Definition: Cell.cs:98
static SourceObj objSource
Definition: Cell.cs:34
bool hasWindow
Definition: Cell.cs:582
bool hasDoorBoat
Definition: Cell.cs:510
bool isFloating
Definition: Cell.cs:486
Cell Front
Definition: Cell.cs:151
bool IsFloorWater
Definition: Cell.cs:763
int _roofBlock
Definition: Cell.cs:58
bool blockSight
Definition: Cell.cs:330
static int Size
Definition: Cell.cs:36
byte shore
Definition: Cell.cs:90
byte topHeight
Definition: Cell.cs:100
byte minHeight
Definition: Cell.cs:102
int _floorMat
Definition: Cell.cs:48
bool isCurtainClosed
Definition: Cell.cs:594
bool CastAmbientShadow
Definition: Cell.cs:901
byte height
Definition: Cell.cs:94
byte autotileObj
Definition: Cell.cs:88
TraitDoor traitDoor
Definition: Cell.cs:124
bool isShadowed
Definition: Cell.cs:268
byte autotileBridge
Definition: Cell.cs:86
bool HasRoof
Definition: Cell.cs:684
bool isSkyFloor
Definition: Cell.cs:606
static bool openPath
Definition: Cell.cs:132
bool isSeen
Definition: Cell.cs:294
bool isSlopeEdge
Definition: Cell.cs:366
bool isShoreSand
Definition: Cell.cs:558
int _decoMat
Definition: Cell.cs:64
static bool openSight
Definition: Cell.cs:130
bool isForceFloat
Definition: Cell.cs:318
bool isSurrounded
Definition: Cell.cs:256
bool isWallEdge
Definition: Cell.cs:438
bool impassable
Definition: Cell.cs:414
static Cell Void
Definition: Cell.cs:10
Cell Right
Definition: Cell.cs:163
bool ignoreObjShadow
Definition: Cell.cs:390
byte bridgeHeight
Definition: Cell.cs:96
bool isBridgeEdge
Definition: Cell.cs:378
int _bridge
Definition: Cell.cs:54
bool HasFullBlock
Definition: Cell.cs:853
SourceDeco.Row sourceDeco
Definition: Cell.cs:1108
bool IsNotWaterEdge
Definition: Cell.cs:724
Cell FrontRight
Definition: Cell.cs:199
int _deco
Definition: Cell.cs:62
bool isSurrounded4d
Definition: Cell.cs:306
virtual bool BlockSight(Cell cell)
Definition: GrowSystem.cs:134
int maxZ
Definition: MapBounds.cs:17
MapBounds bounds
Definition: Map.cs:55
virtual bool IsSnowCovered
Definition: Spatial.cs:545
static TileTypeSky Sky
Definition: TileType.cs:75
virtual byte slopeHeight
Definition: TileType.cs:255
Definition: Trait.cs:7
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsBlockSight
Definition: Trait.cs:56
virtual bool IsOpenPath
Definition: Trait.cs:62
virtual bool IsFloating
Definition: Trait.cs:64
virtual bool IsOpenSight
Definition: Trait.cs:60
virtual byte WeightMod
Definition: Trait.cs:44

References _bridge, _bridgeMat, _deco, _decoMat, _floor, _floorMat, _roofBlock, EClass._zone, autotile, autotileBridge, autotileDeco, autotileObj, Algorithms.WeightCell.baseWeight, blockDir, Algorithms.WeightCell.blocked, blockSight, GrowSystem.BlockSight(), Map.bounds, bridgeHeight, CastAmbientShadow, castFloorShadow, cells, detail, Front, FrontRight, growth, HasBlock, hasDoor, hasDoorBoat, HasFullBlock, HasRoof, hasWindow, height, ignoreObjShadow, impassable, Trait.IsBlockPath, Trait.IsBlockSight, isBridgeEdge, isCurtainClosed, isDeck, IsDeepWater, isFloating, Trait.IsFloating, IsFloorWater, isForceFloat, Card.isHidden, Card.IsInstalled, IsNotWaterEdge, Card.isOn, Trait.IsOpenPath, Trait.IsOpenSight, isSeen, isShadowed, isShoreSand, isSkyFloor, isSlopeEdge, Spatial.IsSnowCovered, isSurrounded, isSurrounded4d, IsTopWater, isWallEdge, lotShade, map, MapBounds.maxZ, minHeight, obj, objSource, openPath, openSight, outOfBounds, Right, room, shadow, shadowMod, shore, Size, TileType.Sky, TileType.slopeHeight, sourceBlock, sourceBridge, sourceDeco, sourceFloor, sourceObj, CellDetail.things, topHeight, Card.trait, traitDoor, Void, Trait.WeightMod, Algorithms.WeightCell.weights, x, and z.

Referenced by GrowSystem.Grow(), Map.RefreshAllTiles(), Map.RefreshNeighborTiles(), Map.RefreshSingleTile(), and Card.SetHidden().

◆ RemoveCard()

void Cell.RemoveCard ( Card  c)
inline

Definition at line 1638 of file Cell.cs.

1639 {
1640 if (c.isChara)
1641 {
1642 if (detail != null)
1643 {
1644 detail.charas.RemoveFromEnd(c.Chara);
1645 }
1646 }
1647 else
1648 {
1649 if (detail != null)
1650 {
1651 detail.things.RemoveFromEnd(c.Thing);
1652 }
1654 {
1656 }
1657 }
1659 }
void TryDespawnDetail()
Definition: Cell.cs:1614

References Card.Chara, CellDetail.charas, detail, GetPoint(), Card.isChara, RenderRow.multisize, Point.RefreshNeighborTiles(), Trait.ShouldRefreshTile, Card.sourceCard, Card.Thing, CellDetail.things, Card.trait, and TryDespawnDetail().

Referenced by Map._RemoveCard(), and Card.SetPlaceState().

◆ Reset()

void Cell.Reset ( )
inline

Definition at line 1597 of file Cell.cs.

1598 {
1599 _block = (_blockMat = (_floor = (_floorMat = (obj = (objMat = 0)))));
1600 decal = (objVal = 0);
1601 bits.Bits = 0u;
1602 bits2.Bits = 0u;
1603 }
byte decal
Definition: Cell.cs:70
byte objVal
Definition: Cell.cs:68
int _blockMat
Definition: Cell.cs:44

References _block, _blockMat, _floor, _floorMat, decal, obj, objMat, and objVal.

Referenced by Map.Reset().

◆ RotateAll()

void Cell.RotateAll ( )
inline

Definition at line 1557 of file Cell.cs.

1558 {
1559 bool flag = EInput.isShiftDown || Input.GetMouseButton(1);
1561 if (mouseTarget.card != null)
1562 {
1563 mouseTarget.card.Rotate(flag);
1564 return;
1565 }
1566 if (detail == null || detail.things.Count == 0)
1567 {
1568 if (HasBlock)
1569 {
1570 if (sourceBlock.tileType.CanRotate(buildMode: false))
1571 {
1572 RotateBlock((!flag) ? 1 : (-1));
1573 }
1574 }
1575 else if (HasObj)
1576 {
1577 if (!sourceObj.tileType.CanRotate(buildMode: false))
1578 {
1579 GrowSystem growSystem = growth;
1580 if (growSystem == null || !growSystem.CanRotate())
1581 {
1582 goto IL_00da;
1583 }
1584 }
1585 RotateObj(flag, sourceObj.tileType.IsUseBlockDir);
1586 }
1587 else if (HasFloor)
1588 {
1589 RotateFloor((!flag) ? 1 : (-1));
1590 }
1591 }
1592 goto IL_00da;
1593 IL_00da:
1595 }
virtual void Rotate(bool reverse=false)
Definition: Card.cs:6720
bool HasFloor
Definition: Cell.cs:681
void RotateBlock(int a)
Definition: Cell.cs:1503
bool HasObj
Definition: Cell.cs:677
void RotateObj(bool reverse=false, bool useBlockDir=false)
Definition: Cell.cs:1535
void RotateFloor(int a)
Definition: Cell.cs:1520
Definition: Core.cs:14
static new Core Instance
Definition: Core.cs:15
Scene scene
Definition: Core.cs:65
virtual bool CanRotate()
Definition: GrowSystem.cs:129
PointTarget mouseTarget
Definition: Scene.cs:135

References GrowSystem.CanRotate(), PointTarget.card, detail, GetPoint(), growth, HasBlock, HasFloor, HasObj, Core.Instance, Scene.mouseTarget, Point.RefreshNeighborTiles(), Card.Rotate(), RotateBlock(), RotateFloor(), RotateObj(), Core.scene, sourceBlock, sourceObj, and CellDetail.things.

Referenced by ActionMode.RotateUnderMouse().

◆ RotateBlock()

void Cell.RotateBlock ( int  a)
inline

Definition at line 1503 of file Cell.cs.

1504 {
1505 int num = blockDir;
1506 int num2 = (sourceBlock.tileType.IsWallOrFence ? 3 : sourceBlock._tiles.Length);
1507 num += a;
1508 if (num < 0)
1509 {
1510 num = num2 - 1;
1511 }
1512 if (num >= num2)
1513 {
1514 num = 0;
1516 }
1517 blockDir = num;
1518 }
bool crossWall
Definition: Cell.cs:642

References blockDir, crossWall, and sourceBlock.

Referenced by TaskBuild.OnProgressComplete(), and RotateAll().

◆ RotateFloor()

void Cell.RotateFloor ( int  a)
inline

Definition at line 1520 of file Cell.cs.

1521 {
1522 int num = floorDir;
1523 num += a;
1524 if (num < 0)
1525 {
1526 num = sourceFloor._tiles.Length - 1;
1527 }
1528 if (num >= sourceFloor._tiles.Length)
1529 {
1530 num = 0;
1531 }
1532 floorDir = num;
1533 }
int floorDir
Definition: Cell.cs:958

References floorDir, and sourceFloor.

Referenced by RotateAll().

◆ RotateObj()

void Cell.RotateObj ( bool  reverse = false,
bool  useBlockDir = false 
)
inline

Definition at line 1535 of file Cell.cs.

1536 {
1537 int num = (useBlockDir ? blockDir : objDir);
1538 num = ((!reverse) ? (num + 1) : (num - 1));
1539 if (num < 0)
1540 {
1541 num = sourceObj._tiles.Length - 1;
1542 }
1543 if (num >= sourceObj._tiles.Length)
1544 {
1545 num = 0;
1546 }
1547 if (useBlockDir)
1548 {
1549 blockDir = num;
1550 }
1551 else
1552 {
1553 objDir = num;
1554 }
1555 }
int objDir
Definition: Cell.cs:946

References blockDir, objDir, and sourceObj.

Referenced by RotateAll().

◆ ToString()

override string Cell.ToString ( )
inline

Definition at line 1131 of file Cell.cs.

1132 {
1133 return "Cell(" + x + "," + z + " " + matBlock?.ToString() + "/" + matFloor?.ToString() + "/" + _block + ")";
1134 }

References _block, matBlock, matFloor, x, and z.

Referenced by TileManager.MakeGrowthTile().

◆ TryDespawnDetail()

void Cell.TryDespawnDetail ( )
inline

Definition at line 1614 of file Cell.cs.

1615 {
1616 if (detail != null && detail.TryDespawn())
1617 {
1618 detail = null;
1619 }
1620 }
bool TryDespawn()
Definition: CellDetail.cs:35

References detail, and CellDetail.TryDespawn().

Referenced by GameDate.AdvanceMin(), Area.OnRemove(), DesignationList< T >.Remove(), RemoveCard(), Area.RemovePoint(), and TransAnime.Update().

◆ TryGetPlant()

PlantData Cell.TryGetPlant ( )
inline

Definition at line 1755 of file Cell.cs.

1756 {
1757 return EClass._map.TryGetPlant(this);
1758 }

References EClass._map, and Map.TryGetPlant().

◆ TryGrow()

void Cell.TryGrow ( VirtualDate  date = null)
inline

Definition at line 1731 of file Cell.cs.

1732 {
1733 growth?.TryGrow(date);
1734 }
void TryGrow(VirtualDate date)
Definition: GrowSystem.cs:331

References growth, and GrowSystem.TryGrow().

Member Data Documentation

◆ _block

◆ _blockMat

int Cell._blockMat

Definition at line 44 of file Cell.cs.

Referenced by PartialMap.Apply(), Map.MineRamp(), Reset(), and Map.Save().

◆ _bridge

◆ _bridgeMat

int Cell._bridgeMat

Definition at line 56 of file Cell.cs.

Referenced by PartialMap.Apply(), Map.Load(), Refresh(), and Map.Save().

◆ _deco

int Cell._deco

Definition at line 62 of file Cell.cs.

Referenced by Recipe.Build(), BaseTileMap.DrawTile(), Refresh(), and Map.Save().

◆ _decoMat

int Cell._decoMat

Definition at line 64 of file Cell.cs.

Referenced by Refresh(), and Map.Save().

◆ _dirs

byte Cell._dirs

Definition at line 66 of file Cell.cs.

Referenced by PartialMap.Apply(), and Map.Save().

◆ _floor

int Cell._floor

◆ _floorMat

int Cell._floorMat

Definition at line 48 of file Cell.cs.

Referenced by PartialMap.Apply(), Refresh(), Reset(), and Map.Save().

◆ _roofBlock

int Cell._roofBlock

◆ _roofBlockDir

byte Cell._roofBlockDir

Definition at line 72 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Map.Save().

◆ _roofBlockMat

int Cell._roofBlockMat

Definition at line 60 of file Cell.cs.

Referenced by PartialMap.Apply(), BaseTileMap.DrawTile(), and Map.Save().

◆ autotile

byte Cell.autotile

Definition at line 82 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ autotileBridge

byte Cell.autotileBridge

Definition at line 86 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ autotileDeco

byte Cell.autotileDeco

Definition at line 84 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ autotileObj

byte Cell.autotileObj

Definition at line 88 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ bits

BitArray32 Cell.bits

Definition at line 118 of file Cell.cs.

◆ bits2

BitArray32 Cell.bits2

Definition at line 120 of file Cell.cs.

◆ blockList

List<SourceBlock.Row> Cell.blockList
static

Definition at line 14 of file Cell.cs.

◆ blockSource

SourceBlock Cell.blockSource
static

Definition at line 26 of file Cell.cs.

Referenced by BaseTileMap.DrawTile().

◆ bridgeHeight

◆ bridgePillar

int Cell.bridgePillar

Definition at line 74 of file Cell.cs.

Referenced by PartialMap.Apply(), RecipeBridgePillar.Build(), BaseTileMap.DrawTile(), and Map.Save().

◆ cells

Cell [,] Cell.cells
static

Definition at line 38 of file Cell.cs.

Referenced by Crawler.Crawl(), and Refresh().

◆ critter

Critter Cell.critter

Definition at line 116 of file Cell.cs.

Referenced by BaseTileMap.DrawTile().

◆ decal

◆ decoList

List<SourceDeco.Row> Cell.decoList
static

Definition at line 18 of file Cell.cs.

◆ decoSource

SourceDeco Cell.decoSource
static

Definition at line 30 of file Cell.cs.

◆ detail

◆ DIV_LIQUID

const int Cell.DIV_LIQUID = 10
static

Definition at line 128 of file Cell.cs.

◆ DivAutotile

const int Cell.DivAutotile = 12
static

Definition at line 40 of file Cell.cs.

◆ DivStage

const int Cell.DivStage = 30
static

Definition at line 134 of file Cell.cs.

◆ effect

◆ effectList

List<SourceCellEffect.Row> Cell.effectList
static

Definition at line 20 of file Cell.cs.

◆ effectSource

SourceCellEffect Cell.effectSource
static

Definition at line 32 of file Cell.cs.

◆ floorList

List<SourceFloor.Row> Cell.floorList
static

Definition at line 16 of file Cell.cs.

◆ floorSource

SourceFloor Cell.floorSource
static

Definition at line 28 of file Cell.cs.

◆ height

◆ highlight

byte Cell.highlight

Definition at line 104 of file Cell.cs.

Referenced by BaseTileMap.DrawTile().

◆ light

◆ lightB

ushort Cell.lightB

◆ lightG

ushort Cell.lightG

◆ lightR

ushort Cell.lightR

◆ map

Map Cell.map
static

Definition at line 8 of file Cell.cs.

Referenced by GetObjName(), and Refresh().

◆ matList

List<SourceMaterial.Row> Cell.matList
static

Definition at line 12 of file Cell.cs.

◆ matSource

SourceMaterial Cell.matSource
static

Definition at line 24 of file Cell.cs.

Referenced by BaseTileMap.DrawTile().

◆ minHeight

byte Cell.minHeight

Definition at line 102 of file Cell.cs.

Referenced by Point.IsBlockByHeight(), and Refresh().

◆ obj

◆ objList

List<SourceObj.Row> Cell.objList
static

Definition at line 22 of file Cell.cs.

◆ objMat

int Cell.objMat

Definition at line 52 of file Cell.cs.

Referenced by PartialMap.Apply(), DyeObj(), Reset(), and Map.Save().

◆ objSource

SourceObj Cell.objSource
static

Definition at line 34 of file Cell.cs.

Referenced by Refresh().

◆ objVal

byte Cell.objVal

Definition at line 68 of file Cell.cs.

Referenced by PartialMap.Apply(), GrowSystem.OnReachNextStage(), Reset(), and Map.Save().

◆ openPath

bool Cell.openPath
staticprivate

Definition at line 132 of file Cell.cs.

Referenced by Refresh().

◆ openSight

bool Cell.openSight
staticprivate

Definition at line 130 of file Cell.cs.

Referenced by Refresh().

◆ pcSync

bool Cell.pcSync

Definition at line 126 of file Cell.cs.

Referenced by Player.CanSee(), and BaseTileMap.DrawTile().

◆ room

◆ shadow

byte Cell.shadow

Definition at line 92 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ shadowMod

byte Cell.shadowMod

Definition at line 98 of file Cell.cs.

Referenced by Refresh().

◆ shore

byte Cell.shore

Definition at line 90 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ Size

int Cell.Size
static

Definition at line 36 of file Cell.cs.

Referenced by Refresh().

◆ topHeight

byte Cell.topHeight

Definition at line 100 of file Cell.cs.

Referenced by Chara._Move(), Point.IsBlockByHeight(), and Refresh().

◆ traitDoor

TraitDoor Cell.traitDoor

Definition at line 124 of file Cell.cs.

Referenced by TileMapElona.DrawTile(), and Refresh().

◆ Void

Cell Cell.Void = new Cell()
static

Definition at line 10 of file Cell.cs.

Referenced by Map.QuickRefreshTile(), and Refresh().

◆ x

◆ z

Property Documentation

◆ Back

◆ BackLeft

Cell Cell.BackLeft
get

Definition at line 234 of file Cell.cs.

235 {
236 get
237 {
238 if (x <= 0 || z + 1 >= Size)
239 {
240 return Void;
241 }
242 return cells[x - 1, z + 1];
243 }
244 }

Referenced by BaseTileMap.DrawTile(), and Map.TryAddRoom().

◆ BackRight

Cell Cell.BackRight
get

Definition at line 222 of file Cell.cs.

223 {
224 get
225 {
226 if (x + 1 >= Size || z + 1 >= Size)
227 {
228 return Void;
229 }
230 return cells[x + 1, z + 1];
231 }
232 }

Referenced by BaseTileMap.DrawTile().

◆ biome

BiomeProfile Cell.biome
get

Definition at line 1114 of file Cell.cs.

1115 {
1116 get
1117 {
1118 if (!(sourceFloor.biome != null))
1119 {
1120 return EClass._zone.biome;
1121 }
1122 return sourceFloor.biome;
1123 }
1124 }
BiomeProfile biome
Definition: Zone.cs:134

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

◆ blockDir

int Cell.blockDir
getset

◆ blockSight

bool Cell.blockSight
getset

Definition at line 329 of file Cell.cs.

330 {
331 get
332 {
333 return bits[9];
334 }
335 set
336 {
337 bits[9] = value;
338 }
339 }
BitArray32 bits
Definition: Cell.cs:118

Referenced by Los.IsBlocked(), Refresh(), and Fov.TraceLine().

◆ CanGrowWeed

bool Cell.CanGrowWeed
get

Definition at line 777 of file Cell.cs.

778 {
779 get
780 {
781 if (obj == 0 && FirstThing == null && !HasBlock && !HasRoof)
782 {
783 if (!IsFarmField)
784 {
785 if (_bridge != 0)
786 {
787 if (matBridge.category == "grass")
788 {
789 return sourceBridge.tag.Contains("weed");
790 }
791 return false;
792 }
793 if (matFloor.category == "grass")
794 {
795 return sourceFloor.tag.Contains("weed");
796 }
797 return false;
798 }
799 return true;
800 }
801 return false;
802 }
803 }
bool IsFarmField
Definition: Cell.cs:766
Thing FirstThing
Definition: Cell.cs:998

Referenced by GrowSystem.OnExceedLastStage().

◆ CastAmbientShadow

bool Cell.CastAmbientShadow
get

Definition at line 901 of file Cell.cs.

Referenced by Refresh().

◆ castFloorShadow

bool Cell.castFloorShadow
getset

Definition at line 533 of file Cell.cs.

534 {
535 get
536 {
537 return bits[28];
538 }
539 set
540 {
541 bits[28] = value;
542 }
543 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ CastShadow

bool Cell.CastShadow
get

Definition at line 899 of file Cell.cs.

◆ Charas

List<Chara> Cell.Charas
get

Definition at line 1024 of file Cell.cs.

◆ crossWall

bool Cell.crossWall
getset

Definition at line 641 of file Cell.cs.

642 {
643 get
644 {
645 return bits2[5];
646 }
647 set
648 {
649 bits2[5] = value;
650 }
651 }
BitArray32 bits2
Definition: Cell.cs:120

Referenced by RotateBlock(), and Map.Save().

◆ fireAmount

int Cell.fireAmount
get

Definition at line 993 of file Cell.cs.

Referenced by LogicalFire.Update().

◆ FirstThing

Thing Cell.FirstThing
get

Definition at line 997 of file Cell.cs.

998 {
999 get
1000 {
1001 CellDetail cellDetail = detail;
1002 if (cellDetail == null || cellDetail.things.Count <= 0)
1003 {
1004 return null;
1005 }
1006 return detail.things[0];
1007 }
1008 }

Referenced by TraitDoor.TryOpen().

◆ floorDir

int Cell.floorDir
getset

Definition at line 957 of file Cell.cs.

958 {
959 get
960 {
961 return _dirs / 32;
962 }
963 set
964 {
965 _dirs = (byte)(_dirs - floorDir * 32 + value * 32);
966 }
967 }

Referenced by PartialMap.Apply(), BaseTileMap.DrawTile(), Recipe.HasSameTile(), and RotateFloor().

◆ Front

◆ FrontLeft

Cell Cell.FrontLeft
get

Definition at line 210 of file Cell.cs.

211 {
212 get
213 {
214 if (x <= 0 || z <= 0)
215 {
216 return Void;
217 }
218 return cells[x - 1, z - 1];
219 }
220 }

Referenced by BaseTileMap.DrawTile().

◆ FrontRight

Cell Cell.FrontRight
get

Definition at line 198 of file Cell.cs.

199 {
200 get
201 {
202 if (x + 1 >= Size || z <= 0)
203 {
204 return Void;
205 }
206 return cells[x + 1, z - 1];
207 }
208 }

Referenced by BaseTileMap.DrawRoof(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), Refresh(), and Map.TryAddRoom().

◆ fullWall

bool Cell.fullWall
getset

Definition at line 473 of file Cell.cs.

474 {
475 get
476 {
477 return bits[23];
478 }
479 set
480 {
481 bits[23] = value;
482 }
483 }

Referenced by BaseTileMap.DrawTile().

◆ gatherCount

int Cell.gatherCount
getset

Definition at line 1026 of file Cell.cs.

1027 {
1028 get
1029 {
1030 if (!map.gatherCounts.ContainsKey(index))
1031 {
1032 return 0;
1033 }
1034 return map.gatherCounts[index];
1035 }
1036 set
1037 {
1038 if (value == 0)
1039 {
1040 if (map.gatherCounts.ContainsKey(index))
1041 {
1042 map.gatherCounts.Remove(index);
1043 }
1044 }
1045 else
1046 {
1047 map.gatherCounts[index] = value;
1048 }
1049 }
1050 }
Dictionary< int, int > gatherCounts
Definition: Map.cs:64

◆ growth

◆ HasBlock

◆ HasBlockOrRamp

bool Cell.HasBlockOrRamp
get

Definition at line 895 of file Cell.cs.

◆ HasBridge

◆ hasDoor

◆ hasDoorBoat

bool Cell.hasDoorBoat
getset

Definition at line 509 of file Cell.cs.

510 {
511 get
512 {
513 return bits[26];
514 }
515 set
516 {
517 bits[26] = value;
518 }
519 }

Referenced by Chara._Move(), and Refresh().

◆ HasFence

bool Cell.HasFence
get

Definition at line 871 of file Cell.cs.

◆ HasFire

bool Cell.HasFire
get

Definition at line 711 of file Cell.cs.

712 {
713 get
714 {
715 if (effect != null)
716 {
717 return effect.IsFire;
718 }
719 return false;
720 }
721 }
bool IsFire
Definition: CellEffect.cs:147
CellEffect effect
Definition: Cell.cs:114

Referenced by RecipeCard.Craft(), GameUpdater.SurfaceUpdater.FixedUpdate(), TaskWater.GetText(), Point.ModFire(), AI_Idle.Run(), TaskWater.Run(), TaskWater.ShouldWater(), and LogicalFire.Transfer().

◆ HasFloodBlock

bool Cell.HasFloodBlock
get

Definition at line 1052 of file Cell.cs.

1053 {
1054 get
1055 {
1056 if (!sourceBlock.tileType.IsFloodBlock)
1057 {
1058 return hasDoor;
1059 }
1060 return true;
1061 }
1062 }

Referenced by BaseTileMap.DrawTile(), Map.SetBlock(), and Map.TryAddRoom().

◆ HasFloor

bool Cell.HasFloor
get

Definition at line 681 of file Cell.cs.

Referenced by Trait.ListPoints(), and RotateAll().

◆ HasFloorOrBlock

bool Cell.HasFloorOrBlock
get

Definition at line 695 of file Cell.cs.

696 {
697 get
698 {
699 if (_block == 0)
700 {
701 return _floor != 0;
702 }
703 return true;
704 }
705 }

◆ HasFullBlock

◆ HasFullBlockOrWallOrFence

bool Cell.HasFullBlockOrWallOrFence
get

Definition at line 855 of file Cell.cs.

856 {
857 get
858 {
859 if (!HasFullBlock)
860 {
861 return HasWallOrFence;
862 }
863 return true;
864 }
865 }
bool HasWallOrFence
Definition: Cell.cs:867

Referenced by TileTypeVine.GetDesiredDir(), TraitDoor.IsOpen(), TraitDoor.IsValid(), and Room.Refresh().

◆ HasHalfBlock

bool Cell.HasHalfBlock
get

Definition at line 893 of file Cell.cs.

◆ HasLadder

bool Cell.HasLadder
get

Definition at line 875 of file Cell.cs.

Referenced by AI_Goto.TryGoTo().

◆ HasLiquid

◆ HasObj

◆ HasRamp

◆ HasRampOrLadder

bool Cell.HasRampOrLadder
get

Definition at line 877 of file Cell.cs.

878 {
879 get
880 {
881 if (!HasRamp)
882 {
883 return HasLadder;
884 }
885 return true;
886 }
887 }
bool HasLadder
Definition: Cell.cs:875

◆ HasRoof

bool Cell.HasRoof
get

Definition at line 683 of file Cell.cs.

684 {
685 get
686 {
687 if (room != null)
688 {
689 return room.lot.idRoofStyle != 0;
690 }
691 return false;
692 }
693 }

Referenced by Chara.CanDuplicate(), GrowSystem.CanGrow(), CardRenderer.Draw(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), GameUpdater.SurfaceUpdater.FixedUpdate(), Zone.GetSpawnPos(), TraitGenerator.OnSimulateHour(), Zone.RainWater(), Refresh(), Trait.TryToggle(), and GameUpdater.Update100ms().

◆ HasSlope

bool Cell.HasSlope
get

Definition at line 889 of file Cell.cs.

Referenced by TileTypeRoof.HitTest().

◆ HasStairs

bool Cell.HasStairs
get

Definition at line 891 of file Cell.cs.

Referenced by Map.GetDependedRamp().

◆ HasWall

bool Cell.HasWall
get

◆ HasWallOrFence

bool Cell.HasWallOrFence
get

◆ hasWindow

bool Cell.hasWindow
getset

Definition at line 581 of file Cell.cs.

582 {
583 get
584 {
585 return bits2[0];
586 }
587 set
588 {
589 bits2[0] = value;
590 }
591 }

Referenced by Refresh().

◆ hidePillar

bool Cell.hidePillar
getset

Definition at line 653 of file Cell.cs.

654 {
655 get
656 {
657 return bits2[6];
658 }
659 set
660 {
661 bits2[6] = value;
662 }
663 }

Referenced by PartialMap.Apply(), RecipeBridgePillar.Build(), and Map.Save().

◆ ignoreObjShadow

bool Cell.ignoreObjShadow
getset

Definition at line 389 of file Cell.cs.

390 {
391 get
392 {
393 return bits[14];
394 }
395 set
396 {
397 bits[14] = value;
398 }
399 }

Referenced by CardRenderer.Draw(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), GrowSystem.OnRenderTileMap(), and Refresh().

◆ impassable

bool Cell.impassable
getset

Definition at line 413 of file Cell.cs.

414 {
415 get
416 {
417 return bits[16];
418 }
419 set
420 {
421 bits[16] = value;
422 }
423 }

Referenced by MapGenRegion.OnGenerateTerrain(), Refresh(), and Map.Save().

◆ index

int Cell.index
get

◆ Installed

Thing Cell.Installed
get

Definition at line 1010 of file Cell.cs.

1011 {
1012 get
1013 {
1014 if (detail == null || detail.things.Count <= 0 || !detail.things[0].IsInstalled)
1015 {
1016 return null;
1017 }
1018 return detail.things[0];
1019 }
1020 }

Referenced by Crawler.Crawl(), GenBounds.IsEmpty(), and GenBounds.ListEmptyPoint().

◆ IsBlocked

bool Cell.IsBlocked
get

Definition at line 931 of file Cell.cs.

Referenced by RecipeCard.Build(), and BaseTileMap.DrawTile().

◆ isBridgeEdge

bool Cell.isBridgeEdge
getset

Definition at line 377 of file Cell.cs.

378 {
379 get
380 {
381 return bits[13];
382 }
383 set
384 {
385 bits[13] = value;
386 }
387 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ IsBridgeWater

bool Cell.IsBridgeWater
get

Definition at line 805 of file Cell.cs.

806 {
807 get
808 {
809 if (_bridge != 0)
810 {
811 return floorSource[_bridge].tileType.IsWater;
812 }
813 return false;
814 }
815 }
static SourceFloor floorSource
Definition: Cell.cs:28

Referenced by BaseTileMap.DrawTile().

◆ isClearArea

bool Cell.isClearArea
getset

Definition at line 617 of file Cell.cs.

618 {
619 get
620 {
621 return bits2[3];
622 }
623 set
624 {
625 bits2[3] = value;
626 }
627 }

Referenced by BaseTileMap.DrawTile(), AM_FlagCell.HitTest(), AM_FlagCell.OnProcessTiles(), and MapSubset.OnSave().

◆ isClearSnow

bool Cell.isClearSnow
getset

Definition at line 461 of file Cell.cs.

462 {
463 get
464 {
465 return bits[22];
466 }
467 set
468 {
469 bits[22] = value;
470 }
471 }

Referenced by Chara._Move(), BaseTileMap.DrawRoof(), BaseTileMap.DrawTile(), AM_FlagCell.HitTest(), AM_FlagCell.OnProcessTiles(), and Map.Save().

◆ isCurtainClosed

bool Cell.isCurtainClosed
getset

Definition at line 593 of file Cell.cs.

594 {
595 get
596 {
597 return bits2[1];
598 }
599 set
600 {
601 bits2[1] = value;
602 }
603 }

Referenced by Refresh().

◆ isDeck

bool Cell.isDeck
getset

Definition at line 521 of file Cell.cs.

522 {
523 get
524 {
525 return bits[27];
526 }
527 set
528 {
529 bits[27] = value;
530 }
531 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ IsDeepWater

bool Cell.IsDeepWater
get

Definition at line 829 of file Cell.cs.

830 {
831 get
832 {
833 if (sourceSurface.tileType.IsDeepWater)
834 {
835 return !IsIceTile;
836 }
837 return false;
838 }
839 }
bool IsIceTile
Definition: Cell.cs:842
SourceFloor.Row sourceSurface
Definition: Cell.cs:1097

Referenced by CanSuffocate(), and Refresh().

◆ IsFarmField

bool Cell.IsFarmField
get

Definition at line 765 of file Cell.cs.

766 {
767 get
768 {
769 if (_bridge != 0)
770 {
771 return sourceBridge.Category.id == "floor_field";
772 }
773 return sourceFloor.Category.id == "floor_field";
774 }
775 }

Referenced by GameUpdater.SurfaceUpdater.FixedUpdate(), and Zone.RainWater().

◆ isFloating

bool Cell.isFloating
getset

Definition at line 485 of file Cell.cs.

486 {
487 get
488 {
489 return bits[24];
490 }
491 set
492 {
493 bits[24] = value;
494 }
495 }

Referenced by Chara._Move(), PartialMap.Apply(), BaseTileMap.DrawTile(), BaseTileMap.GetThingPosition(), CharaActorPCC.OnRender(), and Refresh().

◆ IsFloorWater

◆ isForceFloat

bool Cell.isForceFloat
getset

Definition at line 317 of file Cell.cs.

318 {
319 get
320 {
321 return bits[8];
322 }
323 set
324 {
325 bits[8] = value;
326 }
327 }

Referenced by BaseTileMap.DrawTile(), AM_FlagCell.HitTest(), AM_FlagCell.OnProcessTiles(), Refresh(), and Map.Save().

◆ isHarvested

bool Cell.isHarvested
getset

Definition at line 341 of file Cell.cs.

342 {
343 get
344 {
345 return bits[10];
346 }
347 set
348 {
349 bits[10] = value;
350 }
351 }

Referenced by GrowSystem.CanHarvest(), GrowSystemWheat.GetStageTile(), GrowSystem.OnRenderTileMap(), and Map.Save().

◆ IsIceTile

bool Cell.IsIceTile
get

Definition at line 841 of file Cell.cs.

842 {
843 get
844 {
846 {
847 return !isClearSnow;
848 }
849 return false;
850 }
851 }
bool isClearSnow
Definition: Cell.cs:462
Zone zone
Definition: Map.cs:90

Referenced by CharaActorPCC.OnRender().

◆ IsLotEdge

bool Cell.IsLotEdge
get

Definition at line 915 of file Cell.cs.

916 {
917 get
918 {
919 if (Front.room != null && Right.room != null && FrontRight.room != null && Back.room != null && Left.room != null && (Front.room == null || (!Front.room.data.atrium && Front.HasRoof)))
920 {
921 if (Right.room != null)
922 {
923 return Right.room.data.atrium | !Right.HasRoof;
924 }
925 return false;
926 }
927 return true;
928 }
929 }
bool atrium
Definition: AreaData.cs:66
AreaData data
Definition: BaseArea.cs:29
Cell Back
Definition: Cell.cs:175
Cell Left
Definition: Cell.cs:187

◆ isModified

bool Cell.isModified
getset

Definition at line 449 of file Cell.cs.

450 {
451 get
452 {
453 return bits[21];
454 }
455 set
456 {
457 bits[21] = value;
458 }
459 }

Referenced by Zone.Generate(), Map.MineBlock(), GenRoom.Populate(), and Map.Save().

◆ IsNotWaterEdge

bool Cell.IsNotWaterEdge
get

Definition at line 723 of file Cell.cs.

724 {
725 get
726 {
727 if (!HasFullBlock && !floorSource[_floor].tileType.IsWater)
728 {
729 return floorSource[_floor].edge == 0;
730 }
731 return true;
732 }
733 }

Referenced by Refresh().

◆ isObjDyed

bool Cell.isObjDyed
getset

Definition at line 629 of file Cell.cs.

630 {
631 get
632 {
633 return bits2[4];
634 }
635 set
636 {
637 bits2[4] = value;
638 }
639 }

Referenced by DyeObj(), TraitSeed.MakeSeed(), TaskHarvest.OnCreateProgress(), GrowSystem.PopHarvest(), and Map.Save().

◆ IsRoomEdge

bool Cell.IsRoomEdge
get

Definition at line 903 of file Cell.cs.

904 {
905 get
906 {
907 if (Front.room == room && Right.room == room)
908 {
909 return FrontRight.room != room;
910 }
911 return true;
912 }
913 }

Referenced by BaseTileMap.DrawRoof(), and BaseTileMap.DrawTile().

◆ isSeen

bool Cell.isSeen
getset

◆ isShadowed

bool Cell.isShadowed
getset

Definition at line 267 of file Cell.cs.

268 {
269 get
270 {
271 return bits[1];
272 }
273 set
274 {
275 bits[1] = value;
276 }
277 }

Referenced by Effect._Play(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), and Refresh().

◆ isShoreSand

bool Cell.isShoreSand
getset

Definition at line 557 of file Cell.cs.

558 {
559 get
560 {
561 return bits[30];
562 }
563 set
564 {
565 bits[30] = value;
566 }
567 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ IsSky

bool Cell.IsSky
get

Definition at line 969 of file Cell.cs.

970 {
971 get
972 {
973 if (sourceFloor.tileType == TileType.Sky)
974 {
975 return !HasBridge;
976 }
977 return false;
978 }
979 }
bool HasBridge
Definition: Cell.cs:707

Referenced by Chara.CanMoveTo(), and IsPathBlocked().

◆ isSkyFloor

bool Cell.isSkyFloor
getset

Definition at line 605 of file Cell.cs.

606 {
607 get
608 {
609 return bits2[2];
610 }
611 set
612 {
613 bits2[2] = value;
614 }
615 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ isSlopeEdge

bool Cell.isSlopeEdge
getset

Definition at line 365 of file Cell.cs.

366 {
367 get
368 {
369 return bits[12];
370 }
371 set
372 {
373 bits[12] = value;
374 }
375 }

Referenced by BaseTileMap.DrawTile(), TileMapElona.DrawTile(), and Refresh().

◆ IsSnowTile

◆ isSurrounded

bool Cell.isSurrounded
getset

◆ isSurrounded4d

bool Cell.isSurrounded4d
getset

Definition at line 305 of file Cell.cs.

306 {
307 get
308 {
309 return bits[7];
310 }
311 set
312 {
313 bits[7] = value;
314 }
315 }

Referenced by Refresh().

◆ isToggleWallPillar

bool Cell.isToggleWallPillar
getset

Definition at line 569 of file Cell.cs.

570 {
571 get
572 {
573 return bits[31];
574 }
575 set
576 {
577 bits[31] = value;
578 }
579 }

Referenced by BaseTileMap.DrawTile(), AM_FlagCell.OnProcessTiles(), and Map.Save().

◆ IsTopWater

◆ IsTopWaterAndNoSnow

◆ IsVoid

bool Cell.IsVoid
get

Definition at line 995 of file Cell.cs.

Referenced by Map.GetRampDir().

◆ isWallEdge

bool Cell.isWallEdge
getset

Definition at line 437 of file Cell.cs.

438 {
439 get
440 {
441 return bits[20];
442 }
443 set
444 {
445 bits[20] = value;
446 }
447 }

Referenced by BaseTileMap.Draw(), BaseTileMap.DrawTile(), and Refresh().

◆ isWatered

bool Cell.isWatered
getset

Definition at line 353 of file Cell.cs.

354 {
355 get
356 {
357 return bits[11];
358 }
359 set
360 {
361 bits[11] = value;
362 }
363 }

Referenced by BaseTileMap.DrawTile(), Map.Save(), and TaskWater.ShouldWater().

◆ Left

◆ liquidLv

int Cell.liquidLv
get

Definition at line 981 of file Cell.cs.

982 {
983 get
984 {
985 if (effect != null && effect.LiquidAmount != 0)
986 {
987 return (effect?.LiquidAmount ?? 0) / 3 + 1;
988 }
989 return 0;
990 }
991 }
int LiquidAmount
Definition: CellEffect.cs:174

Referenced by BaseTileMap.DrawTile().

◆ lotShade

bool Cell.lotShade
getset

Definition at line 545 of file Cell.cs.

546 {
547 get
548 {
549 return bits[29];
550 }
551 set
552 {
553 bits[29] = value;
554 }
555 }

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ lotWall

bool Cell.lotWall
getset

Definition at line 497 of file Cell.cs.

498 {
499 get
500 {
501 return bits[25];
502 }
503 set
504 {
505 bits[25] = value;
506 }
507 }

Referenced by BaseTileMap.DrawTile().

◆ matBlock

◆ matBridge

◆ matDeco

SourceMaterial.Row Cell.matDeco
get

Definition at line 1070 of file Cell.cs.

Referenced by BaseTileMap.DrawTile().

◆ matFloor

◆ matObj

◆ matObj_fixed

SourceMaterial.Row Cell.matObj_fixed
get

Definition at line 1076 of file Cell.cs.

1077 {
1078 get
1079 {
1080 if (!isObjDyed)
1081 {
1082 return matSource[objMat];
1083 }
1084 return sourceObj.DefaultMaterial;
1085 }
1086 }
static SourceMaterial matSource
Definition: Cell.cs:24

Referenced by Map.Burn(), Map.MineObj(), GrowSystem.OnMineObj(), and GrowSystemTree.OnMineObj().

◆ matRoofBlock

SourceMaterial.Row Cell.matRoofBlock
get

Definition at line 1064 of file Cell.cs.

Referenced by PartialMap.Save().

◆ nonGradient

bool Cell.nonGradient
getset

Definition at line 401 of file Cell.cs.

402 {
403 get
404 {
405 return bits[15];
406 }
407 set
408 {
409 bits[15] = value;
410 }
411 }

◆ objDir

int Cell.objDir
getset

Definition at line 945 of file Cell.cs.

946 {
947 get
948 {
949 return _dirs / 4 % 8;
950 }
951 set
952 {
953 _dirs = (byte)(_dirs - objDir * 4 + value % 8 * 4);
954 }
955 }

Referenced by PartialMap.Apply(), BaseTileMap.DrawTile(), Recipe.HasSameTile(), and RotateObj().

◆ outOfBounds

bool Cell.outOfBounds
getset

Definition at line 425 of file Cell.cs.

426 {
427 get
428 {
429 return bits[17];
430 }
431 set
432 {
433 bits[17] = value;
434 }
435 }

Referenced by ActPlan._Update(), BaseTileMap.DrawTile(), IsPathBlocked(), WidgetMinimap.OnPointerDown(), Refresh(), and Fov.SetVisible().

◆ Right

◆ skipRender

bool Cell.skipRender
getset

Definition at line 281 of file Cell.cs.

282 {
283 get
284 {
285 return bits[4];
286 }
287 set
288 {
289 bits[4] = value;
290 }
291 }

Referenced by BaseTileMap.DrawTile(), Recipe.OnRenderMarker(), RecipeCard.OnRenderMarker(), and Card.RenderMarker().

◆ sourceBlock

◆ sourceBridge

◆ sourceDeco

SourceDeco.Row Cell.sourceDeco
get

Definition at line 1108 of file Cell.cs.

Referenced by BaseTileMap.DrawTile(), and Refresh().

◆ sourceEffect

SourceCellEffect.Row Cell.sourceEffect
get

◆ sourceFloor

◆ sourceObj

◆ sourceRoofBlock

SourceBlock.Row Cell.sourceRoofBlock
get

Definition at line 1088 of file Cell.cs.

Referenced by PartialMap.Save().

◆ sourceSurface

SourceFloor.Row Cell.sourceSurface
get

◆ Things

List<Thing> Cell.Things
get

◆ toggleOcclusion

bool Cell.toggleOcclusion
getset

Definition at line 665 of file Cell.cs.

666 {
667 get
668 {
669 return bits2[7];
670 }
671 set
672 {
673 bits2[7] = value;
674 }
675 }

Referenced by PartialMap.Apply(), BaseTileMap.DrawTile(), AM_FlagCell.HitTest(), AM_FlagCell.OnProcessTiles(), and Map.Save().

◆ TopHeight

byte Cell.TopHeight
get

Definition at line 138 of file Cell.cs.

139 {
140 get
141 {
142 if (bridgeHeight != 0)
143 {
144 return bridgeHeight;
145 }
146 return height;
147 }
148 }

Referenced by BaseTileMap.Draw(), TileMapElona.Draw(), BaseTileMap.DrawRoof(), and Room.Refresh().

◆ UseLowBlock

bool Cell.UseLowBlock
get

Definition at line 897 of file Cell.cs.

Referenced by BaseTileMap.Draw(), and TileMapElona.Draw().


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