コード例 #1
0
        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);
        }
コード例 #2
0
 public LoadOrderItem(RelativeQuadrantLocation psn, string lbl)
 {
     order = psn; label = lbl;
 }
コード例 #3
0
 public CapacityTableEntry(RelativeQuadrantLocation location, double volume, FluidVolumeUnit unit)
 {
     aLocation   = location;
     aCapacity   = volume;
     aVolumeUnit = unit;
 }