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)))); }
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)))); }
// 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)); }