diff options
Diffstat (limited to 'scripts/map/Tile.cs')
| -rw-r--r-- | scripts/map/Tile.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/map/Tile.cs b/scripts/map/Tile.cs index 865cbbd..e050701 100644 --- a/scripts/map/Tile.cs +++ b/scripts/map/Tile.cs @@ -6,10 +6,34 @@ public partial class Tile : Sprite2D private TileDefinition definition; public bool IsWalkable { get; private set; } + public bool IsTransparent { get; private set; } + + private bool isExplored = false; + public bool IsExplored { + get => this.isExplored; + set { + isExplored = value; + if (IsExplored && !Visible) { + Visible = true; + } + } + } + + private bool isInView = false; + public bool IsInView { + get => this.isInView; + set { + this.isInView = value; + if (IsInView && !IsExplored) { + IsExplored = true; + } + } + } public Tile(Vector2I pos, TileDefinition definition) { Centered = false; + Visible = false; Position = Grid.GridToWorld(pos); SetDefinition(definition); } @@ -18,5 +42,6 @@ public partial class Tile : Sprite2D this.definition = definition; Texture = definition.Texture; IsWalkable = definition.IsWalkable; + IsTransparent = definition.IsTransparent; } } |
