PathableTiles() public static method

public static PathableTiles ( string name, BuildingInfo buildingInfo, CPos position ) : IEnumerable
name string
buildingInfo BuildingInfo
position CPos
return IEnumerable
示例#1
0
        public void Add(Actor b)
        {
            var buildingInfo = b.Info.TraitInfo <BuildingInfo>();

            foreach (var c in FootprintUtils.PathableTiles(b.Info.Name, buildingInfo, b.Location))
            {
                bridges[c] = b;
            }
        }
示例#2
0
        public GroundLevelBridge(Actor self, GroundLevelBridgeInfo info)
        {
            Info      = info;
            this.self = self;
            health    = self.Trait <Health>();

            bridgeLayer = self.World.WorldActor.Trait <BridgeLayer>();
            var buildingInfo = self.Info.TraitInfo <BuildingInfo>();

            cells = FootprintUtils.PathableTiles(self.Info.Name, buildingInfo, self.Location);
        }
示例#3
0
            public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
            {
                if (target.IsDead)
                {
                    return(false);
                }

                var tunnel = target.TraitOrDefault <TunnelEntrance>();

                if (tunnel == null)
                {
                    return(false);
                }

                // HACK: The engine does not support HiddenUnderFog combined with buildings that use the "_" footprint
                // We therefore have to use AlwaysVisible and then force-disable interacting with the entrance under shroud
                var buildingInfo = target.Info.TraitInfoOrDefault <BuildingInfo>();

                if (buildingInfo != null)
                {
                    var footprint = FootprintUtils.PathableTiles(target.Info.Name, buildingInfo, target.Location);
                    if (footprint.All(c => self.World.ShroudObscures(c)))
                    {
                        return(false);
                    }
                }

                if (!tunnel.Exit.HasValue)
                {
                    cursor = info.EnterBlockedCursor;
                    return(false);
                }

                cursor = info.EnterCursor;
                return(true);
            }