Пример #1
0
 public void Tick(World world, Shroud shroud)
 {
     Visible = !Footprint.Any(shroud.IsVisibleTest(FootprintRegion));
     if (flashTicks > 0)
     {
         flashTicks--;
     }
 }
Пример #2
0
        public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud)
        {
            actor         = self;
            isVisibleTest = shroud.IsVisibleTest(footprintRegion);

            Footprint      = footprint;
            CenterPosition = self.CenterPosition;
            Bounds         = self.Bounds;

            UpdateVisibility();
        }
Пример #3
0
        public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shroud shroud)
        {
            actor = self;
            isVisibleTest = shroud.IsVisibleTest(footprintRegion);

            Footprint = footprint;
            CenterPosition = self.CenterPosition;
            Bounds = self.Bounds;

            UpdateVisibility();
        }
Пример #4
0
 void UpdateShroud(Shroud shroud)
 {
     var visibleUnderShroud = shroud.IsExploredTest(updatedRegion);
     var visibleUnderFog = shroud.IsVisibleTest(updatedRegion);
     foreach (var cell in updatedRegion)
     {
         var shrouded = GetEdges(cell, visibleUnderShroud);
         var fogged = GetEdges(cell, visibleUnderFog);
         var shroudTile = tiles[cell];
         var variant = shroudTile.Variant;
         shroudTile.Shroud = GetTile(shroudSprites, shrouded, variant);
         shroudTile.Fog = GetTile(fogSprites, fogged, variant);
         tiles[cell] = shroudTile;
     }
 }