Esempio n. 1
0
        bool CanUnload()
        {
            if (checkTerrainType)
            {
                var terrainType = self.World.Map.GetTerrainInfo(self.Location).Type;

                if (!Info.UnloadTerrainTypes.Contains(terrainType))
                {
                    return(false);
                }
            }

            return(!IsEmpty(self) && (aircraft == null || aircraft.CanLand(self.Location)) &&
                   CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => p.Trait <IPositionable>().CanEnterCell(c))));
        }
Esempio n. 2
0
        public bool CanUnload(bool immediate = false)
        {
            if (checkTerrainType)
            {
                var terrainType = self.World.Map.GetTerrainInfo(self.Location).Type;

                if (!Info.UnloadTerrainTypes.Contains(terrainType))
                {
                    return(false);
                }
            }

            return(!IsEmpty(self) && (aircraft == null || aircraft.CanLand(self.Location, blockedByMobile: false)) &&
                   CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => !p.IsDead && p.Trait <IPositionable>().CanEnterCell(c, null, immediate))));
        }
Esempio n. 3
0
        // Check if we can drop the unit at our current location.
        public bool CanUnload()
        {
            var targetCell = self.World.Map.CellContaining(aircraft.GetPosition());

            return(Carryable != null && aircraft.CanLand(targetCell, blockedByMobile: false));
        }