public void OnInteract(T_Player player) { if (beingUsed) { return; } if (vegetableName == null) { vegetableName = player.RemoveVegetable(); if (vegetableName != null) { if (!player.IsChoppingReduntant(vegetableName)) { vegetableUI.text = vegetableName; this.player = player; SetChopping(true); MusicSource.clip = MusicClip; MusicSource.Play(); } else { vegetableName = null; vegetableUI.text = "-"; } } } }
public void OnInteract(T_Player player) { if (HasEaten) { return; } if (player.ServeCustomer(ingredients)) { player.IncrementScore(ingredients.Count * Constants.SATISFIED_CUSTOMER_REWARD); player.IncrementTime(ingredients.Count * Constants.SATISFIED_CUSTOMER_REWARD_TIME); State = CustomerState.LEAVING; player.ThrowInDustbin(); } else { if (State != CustomerState.ANGRY) { failedServer = player; State = CustomerState.ANGRY; } else { if (player == failedServer) { failedServer.IncrementScore(2 * Constants.ANGRY_CUSTOMER_PENALTY); } else { playerManager.PenalizeAll(); } State = CustomerState.LEAVING; } } }
public void CanGEHALT() { var x = new T_Player("Burian", "Lukas", 120); x.GEHALT_oeffentlich = 2000; Assert.IsTrue(x.GEHALT() == 1000); }
private void CreatePlayer(int level) { GameObject _player = Instantiate <GameObject>(playerPrefab); player = _player.GetComponent <T_Player>(); //UIManager.Instance.SetPotionText(upgrades[2]); switch (level) { case 0: player.Init(0, 0, 0, 0, false); break; case 1: player.Init(0, 0, 0, 0, false, false, false); break; case 2: break; case 3: break; default: break; } }
public void OnInteract(T_Player player) { if (player.ThrowInDustbin()) { player.IncrementScore(Constants.ANGRY_CUSTOMER_PENALTY); } }
static void Main(string[] args) { decimal eingabe; try { F_Player Offensiv_1 = new F_Player("Ronaldo", "Christiano", 186); F_Player Defensiv_1 = new F_Player("Vidic", "Nemanja", 190); T_Player Tennis_1 = new T_Player("Thiem", "Dominik", 175); Console.WriteLine($"Vorname: {Offensiv_1.VORNAME} Nachname: {Offensiv_1.NACHNAME} Groesse: {Offensiv_1.GROESSE}"); Console.WriteLine($"{Offensiv_1.NACHNAME} ist gewachsen. Geben Sie seine neue Groesse ein:"); Offensiv_1.GROESSE = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine($"Vorname: {Offensiv_1.VORNAME} Nachname: {Offensiv_1.NACHNAME} Groesse: {Offensiv_1.GROESSE}"); Console.WriteLine($"Geben Sie die neue Abloesesumme fuer {Defensiv_1.NACHNAME} ein"); eingabe = Convert.ToDecimal(Console.ReadLine()); Offensiv_1.ABLOESESUMME = eingabe; Console.WriteLine($"Abloesesumme fuer {Defensiv_1.NACHNAME} betraegt mit Spielerberater-Aufschlag: {Offensiv_1.Aufschlag_Abloese()}"); Console.WriteLine($"Vorname: {Tennis_1.VORNAME} Nachname: {Tennis_1.NACHNAME} Groesse: {Tennis_1.Update_GROESSE}"); Console.WriteLine($"{Tennis_1.NACHNAME} ist gewachsen. Um wie viel ist er gewachsen?:"); Tennis_1.Update_GROESSE = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine($"Vorname: {Tennis_1.VORNAME} Nachname: {Tennis_1.NACHNAME} Groesse: {Tennis_1.Update_GROESSE}"); Console.WriteLine($"Geben Sie die das echte Gehalt fuer {Tennis_1.NACHNAME} ein"); eingabe = Convert.ToDecimal(Console.ReadLine()); Tennis_1.GEHALT_oeffentlich = eingabe; Console.WriteLine($"{Tennis_1.NACHNAME} verdient offiziell fuer die Medien: {Tennis_1.GEHALT()}"); } catch (Exception e) { Console.WriteLine("Error: " + e.Message); } }
public void CannotUpdateT_PlayerGROESSEWithNegativeValue() { Assert.Catch(() => { var x = new T_Player("Burian", "Lukas", 120); x.Update_GROESSE = -20; }); }
public void CanCreateT_Player() { var x = new T_Player("Burian", "Lukas", 156); Assert.IsTrue(x.VNAME == "Lukas"); Assert.IsTrue(x.NNAME == "Burian"); Assert.IsTrue(x.Update_GROESSE == 156); }
public void Initialize() { playerOne = InitializePlayer(playerOnePrefab, new Vector2(6.63f, -3.25f), "Player 1"); playerTwo = InitializePlayer(playerTwoPrefab, new Vector2(-7.19f, -3.25f), "Player 2"); playerOne.Initialize(this); playerTwo.Initialize(this); }
protected override void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { T_Player player = other.GetComponent <T_Player>(); player.SetCredits(gemValue); StopAllCoroutines(); DestroySelf(); } }
public void OnInteract(T_Player player) { if (vegetableName == null) { vegetableName = player.RemoveVegetable(); if (vegetableName != null) { vegetableUI.text = vegetableName; } } else { if (player.AddVegetable(vegetableName)) { Reset(); } } }
public void OnInteract(T_Player player) { player.AddVegetable(vegetableName); musicSource.clip = musicClip; musicSource.Play(); }
static void Main(string[] args) { //Test Unnamed Method -> Wo sinnvoll einsetzen (also nicht in der main? Warum Unnamed? Fragen!!! Func <decimal, decimal, decimal> gehalt_monat; gehalt_monat = (a, b) => a * b; // das gleich wie -> gehalt_monat = (decimal a, decimal b) => { return a * b; }; decimal eingabe; string test; try { F_Player Offensiv_1 = new F_Player("Ronaldo", "Christiano", 186); F_Player Defensiv_1 = new F_Player("Vidic", "Nemanja", 190); T_Player Tennis_1 = new T_Player("Thiem", "Dominik", 175); T_Player_Jugend Tennis_2 = new T_Player_Jugend("Federer", "Roger", 175, 15); //vererbte Klasse mit zusaetzlichem Field Offensiv_1.ALL_GEHALT = gehalt_monat(2000, 24); Console.WriteLine($"Vorname: {Offensiv_1.VNAME} Nachname: {Offensiv_1.NNAME} Groesse: {Offensiv_1.P_GROESSE} Gehalt: {Offensiv_1.ALL_GEHALT}"); Console.WriteLine($"{Offensiv_1.NNAME} ist gewachsen. Geben Sie seine neue Groesse ein:"); Offensiv_1.P_GROESSE = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine($"Vorname: {Offensiv_1.VNAME} Nachname: {Offensiv_1.NNAME} Groesse: {Offensiv_1.P_GROESSE}"); Console.WriteLine($"Geben Sie die neue Abloesesumme fuer {Defensiv_1.NNAME} ein"); eingabe = Convert.ToDecimal(Console.ReadLine()); Offensiv_1.ABLOESESUMME = eingabe; Console.WriteLine($"Abloesesumme fuer {Defensiv_1.NNAME} betraegt mit Spielerberater-Aufschlag: {Offensiv_1.Aufschlag_Abloese()}"); Console.WriteLine($"Vorname: {Tennis_2.VNAME} Nachname: {Tennis_2.NNAME} Groesse: {Tennis_2.Update_GROESSE} Alter: {Tennis_2.P_ALTER}"); Tennis_2.P_ALTER = 16; Console.WriteLine($"Vorname: {Tennis_2.VNAME} Nachname: {Tennis_2.NNAME} Groesse: {Tennis_2.Update_GROESSE} Alter: {Tennis_2.P_ALTER}"); Console.WriteLine($"Vorname: {Tennis_1.VNAME} Nachname: {Tennis_1.NNAME} Groesse: {Tennis_1.Update_GROESSE}"); Console.WriteLine($"{Tennis_1.NNAME} ist gewachsen. Um wie viel ist er gewachsen?"); Tennis_1.Update_GROESSE = Convert.ToDecimal(Console.ReadLine()); Console.WriteLine($"Vorname: {Tennis_1.VNAME} Nachname: {Tennis_1.NNAME} Groesse: {Tennis_1.Update_GROESSE}"); Console.WriteLine($"Geben Sie die das echte Gehalt fuer {Tennis_1.NNAME} ein"); eingabe = Convert.ToDecimal(Console.ReadLine()); Tennis_1.GEHALT_oeffentlich = eingabe; Console.WriteLine($"{Tennis_1.NNAME} verdient offiziell nur: {Tennis_1.GEHALT()}"); // Task 3 Player x = new Eishockey("Mersich", "David"); x.Print_FULLNAME(); Player y = new Volleyball("Schrammel", "Dominik"); y.Print_FULLNAME(); test = y.NNAME; Console.WriteLine($"Test: Nochmals Nachname: {test}\n"); //TASK 3.4 Player[] array_1 = { new Eishockey("Reichart", "Mario"), new Volleyball("Kowalski", "Pawel"), new Volleyball("Pichler", "Rosamunde"), new Volleyball("Susane", "Reisinger") }; for (var i = 0; i < array_1.Length; i++) { array_1[i].Print_FULLNAME(); } } catch (Exception e) { Console.WriteLine("Error: " + e.Message); } }