// for setting GUI properly public void SetZapfhahnValues(Zapfsaeule selectedZapfsaeule, Zapfhahn selectedZapfhahn, CustomerSimulation customerSimulation) { this.customerSimulation = customerSimulation; this.selectedZapfsaeule = selectedZapfsaeule; this.selectedZapfhahn = selectedZapfhahn; this.selectedFuelType = selectedZapfhahn.GetFuelType(); // Transaction vo de Zapfsüle wo im GUI slektiert isch SelectedFuelLabel.Content = selectedZapfhahn.GetFuelType().GetFuelTypeName(); CostPerLiterTextBlock.Text = $"{(decimal)selectedZapfhahn.GetFuelType().GetCostPerLiterInCent() / 100}.-"; CostBox.Text = this.selectedZapfsaeule.GetCurrentTransactionFuelAmount() * (decimal)this.selectedZapfhahn.GetFuelType().GetCostPerLiterInCent() / 100 + ".-"; LiterBox.Text = this.selectedZapfsaeule.GetCurrentTransactionFuelAmount() + " L"; if (this.selectedZapfsaeule.isTanking()) { TakeFuel.Content = "Stop"; } else if (this.selectedZapfsaeule.isLocked()) { TakeFuel.Content = "Go pay"; TakeFuel.Background = Brushes.LightGray; TakeFuel.IsEnabled = false; } else if (selectedZapfsaeule.isLocked() == false) { TakeFuel.Content = "Start Tanking"; TakeFuel.ClearValue(BackgroundProperty); TakeFuel.IsEnabled = true; } RefreshTransactions(); }
IEnumerator CheckSelfCondition() { if (this.targetPlayer != null) { int engageChance = UnityEngine.Random.Range(0, 100); if (player.GetHP() > engageChance) { this.state = AIMoveState.ENGAGE; } else { this.state = AIMoveState.AVOID; } yield return(new WaitForSeconds(0.2F)); } else if (this.targetObject != null && this.targetPlayer == null) { TakeFuel fuel_condition = targetObject.GetComponent <TakeFuel>(); if (fuel_condition != null && fuel_condition.IsFuelReady()) { this.state = AIMoveState.CATCH; yield return(new WaitForSeconds(0.2F)); } } yield break; }