public void PerformMissionAboveQueueCapacityWithUnskilledTeamShouldFailOldestPutAllOthersOnHold() { // Arrange var soldier = new Ranker("Soldier", 20, 100, 100); this.army.AddSoldier(soldier); var mission1 = new Easy(soldier.OverallSkill); var mission2 = new Medium(soldier.OverallSkill * 100); var mission3 = new Hard(soldier.OverallSkill * 100); var mission4 = new Hard(soldier.OverallSkill * 100); this.missionController.Missions.Enqueue(mission1); this.missionController.Missions.Enqueue(mission2); this.missionController.Missions.Enqueue(mission3); // Act var result = this.missionController.PerformMission(mission4).Trim(); var expectedResult = new StringBuilder() .AppendLine($"Mission declined - {mission1.Name}") .AppendLine($"Mission on hold - {mission2.Name}") .AppendLine($"Mission on hold - {mission3.Name}") .AppendLine($"Mission on hold - {mission4.Name}") .ToString() .Trim(); // Assert Assert.AreEqual(1, this.missionController.FailedMissionCounter, "Incorrect FailedMissionsCounter!"); Assert.AreEqual(0, this.missionController.SuccessMissionCounter, "Incorrect SuccessMissionCounter!"); Assert.AreEqual(3, this.missionController.Missions.Count, "Incorrect Mission count!"); Assert.AreEqual(expectedResult, result, "Incorrect Result msg!"); }
public void PerformMissionAboveQueueCapacityWithSkilledTeamShouldFailOldestExecuteNext() { // Arrange var soldier = new Ranker("Soldier", 20, 100, 100); this.army.AddSoldier(soldier); this.wareHouse.AddAmmunitions(nameof(AutomaticMachine), 1000); this.wareHouse.AddAmmunitions(nameof(Gun), 1000); this.wareHouse.AddAmmunitions(nameof(Helmet), 1000); var mission1 = new Easy(soldier.OverallSkill); var mission2 = new Medium(soldier.OverallSkill); var mission3 = new Hard(soldier.OverallSkill * 100); var mission4 = new Hard(soldier.OverallSkill * 100); this.missionController.Missions.Enqueue(mission1); this.missionController.Missions.Enqueue(mission2); this.missionController.Missions.Enqueue(mission3); // Act var result = this.missionController.PerformMission(mission4).Trim(); var expectedResult = new StringBuilder() .AppendLine($"Mission declined - {mission1.Name}") .AppendLine($"Mission completed - {mission2.Name}") .ToString() .Trim(); // Assert Assert.AreEqual(1, this.missionController.FailedMissionCounter, "Incorrect FailedMissionsCounter!"); Assert.AreEqual(1, this.missionController.SuccessMissionCounter, "Incorrect SuccessMissionCounter!"); Assert.AreEqual(2, this.missionController.Missions.Count, "Incorrect Mission count!"); Assert.AreEqual(true, result.StartsWith(expectedResult), "Incorrect Result msg!"); }
public IEnumerator <Container> GetEnumerator() { var list = new List <Container>(); foreach (var item in Root) { list.Add(item); } if (Soft.Any()) { list.Add(new Container { Text = nameof(Soft), Root = Soft }); } if (Hard.Any()) { list.Add(new Container { Text = nameof(Hard), Root = Hard }); } return(list.GetEnumerator()); }
void RegeneratePositionAndSpeed() { //initialPos = GenRandomPos (); initialPos = Hard.GenPosAccordingToPanelIndex(panelIndex); speed = Hard.GenRandomSpeed(); gameObject.transform.position = initialPos; }
// Use this for initialization void Start() { GameObject explosion = this.gameObject.transform.FindChild ("Explosion").gameObject; barrel = this.gameObject.AddComponent<Hard>() as Hard; sounds = GetComponents<AudioSource> (); barrel.construct (this.gameObject, explosion, sounds[1]); }
public void AddTwoNumbers() { /* * Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). * You also have several balls in your hand. * Each time, you may choose a ball in your hand, and insert it into the row (including the leftmost place and rightmost place). * Then, if there is a group of 3 or more balls in the same color touching, remove these balls. * Keep doing this until no more balls can be removed. * Find the minimal balls you have to insert to remove all the balls on the table. * If you cannot remove all the balls, output -1. * * Input: "WWRRBBWW", "WRBRW" * Output: 2 * Explanation: WWRRBBWW -> WWRR[R]BBWW -> WWBBWW -> WWBB[B]WW -> WWWW -> empty */ //Arrange var board = "WWRRBBWW"; var hand = "WRBRW"; var expected = 2; var target = new Hard(); //act int actual = target.FindMinStep(board, hand); //assert Assert.AreEqual(expected, actual); }
private void Leaderboards_Paint(object sender, PaintEventArgs e) { Easy.Draw(e.Graphics); Medium.Draw(e.Graphics); Hard.Draw(e.Graphics); Back.Draw(e.Graphics); }
private Hard hard; // Сама пушка // Use this for initialization void Start() { StartCoroutine(DestroyThis()); hard = transform.parent.parent.GetComponent <Hard>(); gameObject.GetComponent <Rigidbody>().AddForce(hard.tank.transform.forward * 1000); transform.SetParent(GameObject.FindWithTag("BulletsPocket").transform); // Для абстрагирования от положения танка назначаем нового родителя }
void SetInitialDifficulty(string difficulty) { switch (difficulty) { case "easy": Medium.SetActive(false); Hard.SetActive(false); break; case "medium": Easy.SetActive(false); Hard.SetActive(false); break; case "hard": Easy.SetActive(false); Medium.SetActive(false); break; } }
private void Lead_MouseMove(object sender, MouseEventArgs e) { Back.isHit(e.X, e.Y); Easy.isHit(e.X, e.Y); Medium.isHit(e.X, e.Y); Hard.isHit(e.X, e.Y); Invalidate(); }
public void MissionOnHold() { var mission = new Hard(200.0); var resultString = this.mc.PerformMission(mission).Trim(); var expectedString = string.Format(OutputMessages.MissionOnHold, mission.Name); Assert.AreEqual(expectedString, resultString); }
public void PerformMissionWithoutEnoughSoldiersReturnsCorrectMessage() { var mission = new Hard(20); var message = this.sut.PerformMission(mission).Trim(); Assert.AreEqual($"Mission on hold - {mission.Name}", message); }
public void TestHard() { var hard = new Hard(); Level level2; level2 = LevelFactory.CreateLevel("Hard"); Assert.Equal(hard.levelType, level2.levelType); }
public void FaildMissinOnHoldZero() { IMission mission = new Hard(30); this.missionController.FailMissionsOnHold(); Assert.That(this.missionController.FailedMissionCounter, Is.EqualTo(0)); }
public void Run() { var car = new Car(12, 160, new Hard("Gumichka", 100, 100)); var tyre = new Hard("ailqk", 12, 12); tyre.Degradation -= 100; tyre.Degradation -= 5; Console.WriteLine(); }
public static Hard where () { if (instance == null) { instance = new Hard(); } instance.knock(); return(instance); }
void HardEntrySelected(object sender, PlayerIndexEventArgs e) { Hard hardDiff = new Hard(); GameScreen[] screensToLoad = new GameScreen[2]; screensToLoad[0] = new BackgroundScreen(true, true); screensToLoad[1] = new ScoreAttackScreen(hardDiff, e.PlayerIndex); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad); }
public void HardDifficulty() { PlayerPreferences.SetEasyDifficulty(0); PlayerPreferences.SetMediumDifficulty(0); PlayerPreferences.SetHardDifficulty(1); Easy.SetActive(false); Medium.SetActive(false); Hard.SetActive(true); }
private void Menu_Paint(object sender, PaintEventArgs e) { Play.Draw(e.Graphics); Achiev.Draw(e.Graphics); Quit.Draw(e.Graphics); Leaderboards.Draw(e.Graphics); Easy.Draw(e.Graphics); Medium.Draw(e.Graphics); Hard.Draw(e.Graphics); }
public void FailMissionsOnHoldIncreasesFailedMissionCounterCorrectly() { var mission = new Hard(20); this.sut.PerformMission(mission); this.sut.FailMissionsOnHold(); Assert.AreEqual(1, this.sut.FailedMissionCounter); }
void Start() { easy = new Easy(); medium = new Medium(); hard = new Hard(); difficultyLevel = medium; playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); canvas = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <UberCanvasScript>(); }
public void AddHardMissionsToController() { //Arrange IMission hard = new Hard(100); //Act this.sut.Missions.Enqueue(hard); //Assert Assert.AreEqual(1, 1); }
private void Menu_MouseMove(object sender, MouseEventArgs e) { Play.isHit(e.X, e.Y); Achiev.isHit(e.X, e.Y); Leaderboards.isHit(e.X, e.Y); Quit.isHit(e.X, e.Y); Easy.isHit(e.X, e.Y); Medium.isHit(e.X, e.Y); Hard.isHit(e.X, e.Y); Invalidate(); }
public void PerformMissionDeclinesFirstWaitingMissionWhenTheWaitingOnesAreMoreThanThree() { var mission = new Hard(20); this.sut.PerformMission(mission); this.sut.PerformMission(mission); this.sut.PerformMission(mission); var message = this.sut.PerformMission(mission).Trim(); Assert.IsTrue(message.StartsWith($"Mission declined - {mission.Name}")); }
public void DequeMissionFromController() { //Arrange IMission hard = new Hard(100); //Act this.sut.Missions.Enqueue(hard); this.sut.Missions.Dequeue(); //Assert Assert.AreEqual(0, 0); }
public void FailedMissionIncreasesFailedCounter() { var easy = new Easy(10.0); var medium = new Medium(150.0); var hard = new Hard(200.0); this.mc.Missions.Enqueue(easy); this.mc.Missions.Enqueue(medium); this.mc.Missions.Enqueue(hard); this.mc.PerformMission(hard); Assert.AreEqual(1, this.mc.FailedMissionCounter); }
public void FailMissionsOnHoldIncreasesFailedMissionCounterCorrectly() { // Arrange var mission = new Hard(20); this.sut.PerformMission(mission).Trim(); // Act this.sut.FailMissionsOnHold(); // Assert Assert.AreEqual(1, this.sut.FailedMissionCounter); }
public void PerformMissionCannotEnqueMoreThanThreeMissionsOnHold() { var mission1 = new Hard(20); var mission2 = new Hard(20); var mission3 = new Hard(20); var mission4 = new Hard(20); this.sut.PerformMission(mission1); this.sut.PerformMission(mission2); this.sut.PerformMission(mission3); this.sut.PerformMission(mission4); Assert.AreEqual(3, this.sut.Missions.Count); }
public void MoreThanThreeMissionsInQueueShouldDeclineMission() { var easy = new Easy(200.0); var medium = new Medium(200.0); var hard = new Hard(200.0); this.mc.Missions.Enqueue(easy); this.mc.Missions.Enqueue(medium); this.mc.Missions.Enqueue(hard); var resultString = this.mc.PerformMission(hard).Trim(); var expectedString = "Mission declined - Suppression of civil rebellion\r\nMission on hold - Capturing dangerous criminals\r\nMission on hold - Disposal of terrorists\r\nMission on hold - Disposal of terrorists"; Assert.AreEqual(expectedString, resultString); }
static void Main(string[] args) { Console.WriteLine("где сердце?"); Hard.where (); Console.WriteLine("начинаем смотреть аниме"); naruto Uzumaki = new naruto(); for (int i = 0; i < 6; i++) { Uzumaki.shadow_cloning(); } Console.WriteLine("бог решил дать вам возможность создать новый вид пауков"); god god = new god(); god.game().inf(); Console.ReadLine(); }
public void Awake() { Cursor.visible = true; anim = GetComponent <Animator>(); mediumScript = GetComponent <Medium>(); hardScript = GetComponent <Hard>(); string saveMedium = File.ReadAllText(Application.dataPath + "/medium.txt"); Medium.SaveBollean saveBollean = JsonUtility.FromJson <Medium.SaveBollean>(saveMedium); mediumBool = saveBollean.medium; string saveHard = File.ReadAllText(Application.dataPath + "/hard.txt"); Hard.SaveBoollean saveBoollean = JsonUtility.FromJson <Hard.SaveBoollean>(saveHard); hardBool = saveBoollean.hard; Debug.Log(mediumBool); Debug.Log(hardBool); }