protected virtual void OnSpotAssigned(CustomerSpot newSpot, Customer customer) { if (customer.GetInstanceID() == GetInstanceID()) { if (spot != null) { spot.Free(); } spot = newSpot; newSpot.customer = this; } }
private void OnCustomerSpotFreed(CustomerSpot spot) { //If the spot is in QueueSpots: // assign the spot to the next customer in queue for (int i = 0; i < QueueSpots.Length - 1; i++) { if (QueueSpots[i].Equals(spot)) { if (QueueSpots[i + 1].Claimed && SpotAssigned != null) { SpotAssigned(spot, QueueSpots[i + 1].customer); } } } }