public Quadrant(QuadrantId quadrantId) { myResources = new QuadrantResource[(int)RelativeQuadrantLocation.NUM_RELATIVE_QUADRANT_LOCATIONS]; myQuadrantId = quadrantId; // Initialise the Quadrant Resources that are also Receptacles for (RelativeQuadrantLocation location = RelativeQuadrantLocation.START_LOCATION; location < RelativeQuadrantLocation.NUM_RELATIVE_QUADRANT_LOCATIONS; ++location) { // Assume the QuadrantReceptacleCapacityTable is not in any particular order. // In other words, search the table for the relevant QuadrantLocation details. for (int entryIndex = 0; entryIndex < theQuadrantReceptacleCapacityTable.GetLength(0); ++entryIndex) { if (location == theQuadrantReceptacleCapacityTable[entryIndex].aLocation) { double amount = theQuadrantReceptacleCapacityTable[entryIndex].aCapacity; FluidVolumeUnit unit = theQuadrantReceptacleCapacityTable[entryIndex].aVolumeUnit; FluidVolume capacity = new FluidVolume(amount, unit); myResources[(int)location] = new Receptacle(capacity); break; // Proceed with the next 'location' } } } // Initialise the Quadrant Resources that are not Receptacles myResources[(int)RelativeQuadrantLocation.TipsBox] = new QuadrantResource(); //Set the initial state of the quadrant Clear(false); }
public FluidVolume(double amount, FluidVolumeUnit unit) { myVolume = amount; myVolumeUnit = FluidVolumeUnit.MilliLitres; // Assume mL myVolumeUnit = unit; // Adjust volume value if required }
public CapacityTableEntry(RelativeQuadrantLocation location, double volume, FluidVolumeUnit unit) { aLocation = location; aCapacity = volume; aVolumeUnit = unit; }