Пример #1
0
 public void checkValidityInputArgumentsBuildStationAndBuffer(int exitRow, int exitColumn, int entryRow, int entryColumn, int stationRow, int stationColumn, waypointTypes typeOfStation)
 {
     //check validity input arguments
     if (exitRow < 0 || stationRow < 0 || entryRow < 0 || exitColumn < 0 || stationColumn < 0 || entryColumn < 0)
     {
         throw new ArgumentException("something went wrong while constructing the station, one or more are negative, exitRow: " + exitRow + ", stationRow: " + stationRow + ", entryRow: " + entryRow + ", exitColumn: " + exitColumn + ", stationColumn: " + stationColumn + ", entryColumn: " + entryColumn);
     }
     if (exitRow != stationRow && exitColumn != stationColumn)
     {
         throw new ArgumentException("something went wrong while constructing the station, exitRow != stationRow && exitColumn != stationColumn, exitRow: " + exitRow + ", stationRow: " + stationRow + ", exitColumn: " + exitColumn + ", stationColumn: " + stationColumn);
     }
     if (exitRow != entryRow && exitColumn != entryColumn)
     {
         throw new ArgumentException("something went wrong while constructing the station, exitRow != entryRow && exitColumn != entryColumn, exitRow: " + exitRow + ", entryRow: " + entryRow + ", exitColumn: " + exitColumn + ", entryColumn: " + entryColumn);
     }
     if (exitRow == stationRow && exitColumn == stationColumn)
     {
         throw new ArgumentException("something went wrong while constructing the station, exitRow == stationRow && exitColumn == stationColumn, exitRow: " + exitRow + ", exitColumn: " + exitColumn);
     }
     if (exitRow == entryRow && exitColumn == entryColumn)
     {
         throw new ArgumentException("something went wrong while constructing the station, exitRow == entryRow && exitColumn == entryColumn, exitRow: " + exitRow + ", exitColumn: " + exitColumn);
     }
     if (stationColumn == entryRow && stationColumn == entryColumn)
     {
         throw new ArgumentException("something went wrong while constructing the station, stationRow == entryRow && stationColumn == entryColumn, stationRow: " + stationRow + ", stationColumn: " + stationColumn);
     }
     if (!typeOfStation.Equals(waypointTypes.PickStation) && !typeOfStation.Equals(waypointTypes.ReplenishmentStation) && !typeOfStation.Equals(waypointTypes.Elevator))
     {
         throw new ArgumentException("!typeOfStation.Equals(waypointTypes.PickStation) && !typeOfStation.Equals(waypointTypes.ReplenishmentStation) && !typeOfStation.Equals(waypointTypes.Elevator)");
     }
 }
Пример #2
0
        public Tile(directions d, Waypoint wp, waypointTypes type)
        {
            this.direction = d;
            this.wp        = wp;
            this.type      = type;

            if (type.Equals(waypointTypes.StorageLocation) && !d.Equals(directions.EastNorthSouthWest))
            {
                throw new ArgumentException("something went wrong with storage locations");
            }
            if (d.Equals(directions.Invalid))
            {
                throw new ArgumentException("direction invalid");
            }
            if (wp == null)
            {
                throw new ArgumentException("wp is null");
            }
        }