/// <summary> /// Checks if CurrentlyCarriedCustomer is supposed to be dropped off at the /// platform supplied as the method argument /// </summary> /// <param name="platform">Platform to test</param> private void TryDeliverCustomer(Platform platform) { var customer = CurrentlyCarriedCustomer; if (customer == null) { return; } if (!customer.IsDestination(platform)) { return; } CustomerDespawnEvents.ResetContainer(); PlayerScore += customer.Points; CurrentlyCarriedCustomer = null; }
/// <summary> /// Restarts the level /// </summary> public void RestartLevel() { player.Reset(); player.Shape.Position = playerStartingPosition; //reset all fields required for level restart CurrentlyCarriedCustomer = null; CustomerDespawnEvents.ResetContainer(); activeCustomersInlevel.ClearContainer(); customerSpawnEvents.ResetContainer(); GenerateCustomerSpawnEvents(); PlayerScore = 0; }
public void Initialize() { processor.ResetEventCount(); container.ResetContainer(); }