public void BattleOfWits() { var sicilianMock = new Mock <ISicilian>(); var goblet1 = new Goblet(); var goblet2 = new Goblet(); sicilianMock.Setup(x => x.SelectGlass(goblet1, goblet2)).Returns(goblet1); var sut = new TestMe(sicilianMock.Object); Goblet result = sut.Inconceivable(goblet1, goblet2); sicilianMock.Verify(x => x.SelectGlass(goblet1, goblet2), Times.Once()); Assert.AreEqual(goblet2, result); }
private bool IncrementPlayerScore(List <PlayerID> winners) { bool scoreReached = false; foreach (PlayerID id in winners) { GameObject go = (GameObject)GameObject.Instantiate(bloodDrainPrefab); go.GetComponent <BloodDrainEffect>().start = GetPlayer(id).transform.position; Enums.Characters c = characterToPlayer.FirstOrDefault(x => x.Value == id).Key; Goblet g = goblets.Find(x => x.character.Equals(c)); go.GetComponent <BloodDrainEffect>().end = g.transform.position; playerScores[((int)id) - 1] += pointStep; g.UpdateScale(Mathf.Clamp01(((float)playerScores[((int)id) - 1]) / (float)MAX_SCORE)); if (playerScores[((int)id) - 1] >= MAX_SCORE) { scoreReached = true; winningCharacter = c; } } return(scoreReached); }
public void ResetGame() { Camera.main.GetComponent <Animator>().SetTrigger("RestartGame"); for (int i = 0; i < 4; i++) { playerScores[i] = 0; } foreach (PlayerID id in characterToPlayer.Values) { Enums.Characters c = characterToPlayer.FirstOrDefault(x => x.Value == id).Key; Goblet g = goblets.Find(x => x.character.Equals(c)); g.UpdateScale(Mathf.Clamp01(((float)playerScores[((int)id) - 1]) / (float)MAX_SCORE)); } inGame = true; for (int i = 0; i < controllers.Count; i++) { controllers[i].Enable(); RespawnNode playerNode = respawnNodes.Find(x => x.ID.Equals(controllers[i].ID)); controllers[i].transform.position = playerNode.transform.position; } }
public Goblet Inconceivable(Goblet first, Goblet second) { return(_dependency.SelectGlass(first, second)); }
public GiftBag(bool nice) { Item item = null; Hue = Utility.RandomList(32, 64, 2301); if (nice) { Name = "Happy Holidays!"; DropItem(MakeNewbie(new WristWatch())); if (Utility.RandomBool()) { item = new Food(4164); item.Hue = 432; item.Name = "fruit cake"; DropItem(MakeNewbie(item)); } else { DropItem(MakeNewbie(new Pizza())); } if (Utility.RandomBool()) { DropItem(MakeNewbie(new BeverageBottle(BeverageType.Champagne))); } else { DropItem(MakeNewbie(new BeverageBottle(BeverageType.EggNog))); } switch (Utility.Random(7)) { default: case 0: DropItem(MakeNewbie(new Apple())); break; case 1: DropItem(MakeNewbie(new Pear())); break; case 2: DropItem(MakeNewbie(new Bananas())); break; case 3: DropItem(MakeNewbie(new Dates())); break; case 4: DropItem(MakeNewbie(new Coconut())); break; case 5: DropItem(MakeNewbie(new Peach())); break; case 6: DropItem(MakeNewbie(new Grapes())); break; } item = new Goblet(); item.Name = "a champagne glass"; item.Hue = 71; DropItem(MakeNewbie(item)); item = new Goblet(); item.Name = "a champagne glass"; item.Hue = 34; DropItem(MakeNewbie(item)); DropItem(MakeNewbie(new FireworksWand(100))); item = new BaseItem(5359); item.Hue = Utility.RandomList(32, 64, 2301); item.Name = "Seasons Greetings"; DropItem(MakeNewbie(item)); } else { Name = "You were naughty this year!"; DropItem(MakeNewbie(new Food(4164))); // spam DropItem(MakeNewbie(new Coal())); item = new Kindling(); item.Name = "switches"; DropItem(item); // not newbied... item = new BaseItem(5359); item.Hue = Utility.RandomList(32, 64, 2301); item.Name = "Maybe next year you will get a nicer gift."; DropItem(MakeNewbie(item)); } }
public GiftBag(bool nice) { Item item = null; Hue = Utility.RandomList(32, 77, 2301); if (nice) { Name = "Happy Holidays!"; DropItem(MakeNewbie(new WristWatch())); if (Utility.RandomBool()) { item = new Cake() { ItemID = 4164 }; item.Hue = 432; item.Name = "fruit cake"; DropItem(MakeNewbie(item)); } else { DropItem(MakeNewbie(new Pizza())); } if (Utility.RandomBool()) { DropItem(MakeNewbie(new BeverageBottle(BeverageType.Champagne))); } else { DropItem(MakeNewbie(new BeverageBottle(BeverageType.Eggnog))); } DropItem(MakeNewbie(new Dates())); item = new Goblet(); item.Name = "a champagne glass"; item.Hue = Utility.RandomList(77, 34); DropItem(MakeNewbie(item)); /*item = new Goblet(); * item.Name = "a champagne glass"; * item.Hue = 34; * DropItem(MakeNewbie(item));*/ DropItem(MakeNewbie(new FireworksWand(100))); item = new Item(5359); item.Hue = Utility.RandomList(32, 77, 2301); item.Name = "Seasons Greetings"; DropItem(MakeNewbie(item)); } else { Name = "You were naughty this year!"; DropItem(MakeNewbie(new Cake() { ItemID = 4164, Name = "spam" })); // spam DropItem(MakeNewbie(new Coal())); item = new Kindling(); item.Name = "switches"; DropItem(item); // not newbied... item = new Item(5359); item.Hue = Utility.RandomList(32, 77, 2301); item.Name = "Maybe next year you will get a nicer gift."; DropItem(MakeNewbie(item)); } }