AlertSpeaker.Building_AlertSpeaker.GetEffectZoneCells C# (CSharp) Method

GetEffectZoneCells() public static method

Get the effect zone cells.
public static GetEffectZoneCells ( IntVec3 alertSpeakerPosition ) : List
alertSpeakerPosition IntVec3
return List
        public static List<IntVec3> GetEffectZoneCells(IntVec3 alertSpeakerPosition)
        {
            IEnumerable<IntVec3> cellsInRange = GenRadial.RadialCellsAround(alertSpeakerPosition, Building_AlertSpeaker.alertSpeakerMaxRange, true);
            List<IntVec3> effectZoneCells = new List<IntVec3>();
            foreach (IntVec3 cell in cellsInRange)
            {
                if (cell.GetRoom() == alertSpeakerPosition.GetRoom())
                {
                    effectZoneCells.Add(cell);
                }
            }
            return effectZoneCells;
        }

Usage Example

        /// <summary>
        /// Performs the drawing treatment. Applies the drawing parameters.
        /// </summary>
        public override void Draw()
        {
            base.Draw();

            if (Find.Selector.IsSelected(this))
            {
                List <IntVec3> cellsInEffectZone = Building_AlertSpeaker.GetEffectZoneCells(this.Position);
                GenDraw.DrawFieldEdges(cellsInEffectZone);
            }
        }
All Usage Examples Of AlertSpeaker.Building_AlertSpeaker::GetEffectZoneCells