OpenRA.Traits.Shroud.Contains C# (CSharp) Method

Contains() public method

public Contains ( PPos uv ) : bool
uv PPos
return bool
        public bool Contains(PPos uv)
        {
            // Check that uv is inside the map area. There is nothing special
            // about explored here: any of the CellLayers would have been suitable.
            return explored.Contains((MPos)uv);
        }

Usage Example

Exemplo n.º 1
0
        public FrozenActor(Actor self, PPos[] footprint, Shroud shroud, bool startsRevealed)
        {
            actor           = self;
            this.shroud     = shroud;
            NeedRenderables = startsRevealed;

            // Consider all cells inside the map area (ignoring the current map bounds)
            Footprint = footprint
                        .Where(m => shroud.Contains(m))
                        .ToArray();

            if (Footprint.Length == 0)
            {
                throw new ArgumentException(("This frozen actor has no footprint.\n" +
                                             "Actor Name: {0}\n" +
                                             "Actor Location: {1}\n" +
                                             "Input footprint: [{2}]\n" +
                                             "Input footprint (after shroud.Contains): [{3}]")
                                            .F(actor.Info.Name,
                                               actor.Location.ToString(),
                                               footprint.Select(p => p.ToString()).JoinWith("|"),
                                               footprint.Select(p => shroud.Contains(p).ToString()).JoinWith("|")));
            }

            CenterPosition = self.CenterPosition;
            Bounds         = self.Bounds;
            TargetTypes    = self.GetEnabledTargetTypes().ToHashSet();

            tooltip = self.TraitsImplementing <ITooltip>().FirstOrDefault();
            health  = self.TraitOrDefault <IHealth>();

            UpdateVisibility();
        }
All Usage Examples Of OpenRA.Traits.Shroud::Contains