static void Hero() { var client = new GothamCity(); var poisonIvy = new PoisonIvy(); client.HandleVillain(poisonIvy); Console.WriteLine(poisonIvy); var clayface = new Clayface(); client.HandleVillain(clayface); Console.WriteLine(clayface); var joker = new Joker(); client.HandleVillain(joker); Console.WriteLine(joker); try { var bane = new Bane(); client.HandleVillain(bane); } catch (Exception e) { Console.WriteLine(e.Message); } }
static void Main(string[] args) { Console.SetWindowSize(100, 60); Console.ForegroundColor = ConsoleColor.DarkGray; Console.BackgroundColor = ConsoleColor.Black; Console.WriteLine("Добро пожаловать в змейку! Веселитесь!"); Console.WriteLine("Выберите и напишите размер поля N x N"); Console.WriteLine("Управление WASD или стрелочки"); Console.WriteLine("Всего три уровня сложности: "); Console.WriteLine("Легкий уровень - [поле10х10, скорость медленная]"); Console.WriteLine("Средний уровень - [поле15х15, скорость нормальная]"); Console.WriteLine("Сложный уровень - [поле20х20, скорость быстрая]"); Console.WriteLine("Введите размер поля:"); Joker koker = new Joker(); koker.Setup(koker.gameOver); while (!koker.gameOver) { koker.Privet(); koker.Draw(); koker.Logic(); koker.Move(); koker.itog(); } Console.ReadLine(); }
public void itog() { //змейка не умирает когда выходит за границу поля, она появляется с другой (зеркальной) стороны if (x > S) { x = 0; } else if (x < 0) { x = S - 2; } if (y > V) { y = 0; } else if (y < 0) { y = V - 2; } for (int g = 0; g < nomerhv; g++) { if (hvostX[g] == x && hvostY[g] == y) { gameOver = true; Console.WriteLine("Game Over"); Console.WriteLine("YOU IDIOT!!!"); Console.WriteLine("Введите размерность нового поля: "); Console.WriteLine("Нажмите клавишу 'ENTER' "); Console.ReadKey(); } } //перезапуск игры в случае смерти if (gameOver != false) { Console.Clear(); { Joker class1 = new Joker(); class1.Setup(class1.gameOver); while (!class1.gameOver) { class1.Privet(); class1.Draw(); class1.Logic(); class1.Move(); class1.itog(); } Console.ReadKey(true); } } if (x == celX && y == celY) { //Подсчет очков schet += 10; celX = R.Next(3, S - 2); celY = R.Next(3, S - 2); nomerhv++; } }
static void Heroes() { var robin = new Robin(); var batman = new Batman(robin); var joker = new Joker(); var harleyQuinn = new HarleyQuinn(); batman.Goto("Bludhaven"); batman.Fight(harleyQuinn); batman.Fight(joker); batman.Goto("Hall of Justice"); }
public void should_clear_all_items_in_container() { //arrange var superman = new Superman(); Container.Put(Binding.Use <ISuper>(superman)); var joker = new Joker(); Container.Put(Binding.Use <IVillain>(joker).Named("joker")); //act Container.Dispose(); //assert Container.Has(typeof(ISuper)).Should().BeFalse(); Container.Has(typeof(IVillain), "joker").Should().BeFalse(); }
public void GetNumberOfDecksTest6() { Assert.That(Joker.GetNumberOfDecks(3, new long[] { 2, 2, 2, 2 }), Is.EqualTo(4)); }
public void GetNumberOfDecksTest3() { Assert.That(Joker.GetNumberOfDecks(5, new long[] { 1 }), Is.EqualTo(6)); }
public void GetNumberOfDecksTest2() { Assert.That(Joker.GetNumberOfDecks(4, new long[] { 1, 2, 3 }), Is.EqualTo(3)); }
public void GetNumberOfDecksTest1() { Assert.That(Joker.GetNumberOfDecks(3, new long[] { 10, 15 }), Is.EqualTo(13)); }
public void should_clear_all_items_in_container() { //arrange var superman = new Superman(); Container.Put(Binding.Use<ISuper>(superman)); var joker = new Joker(); Container.Put(Binding.Use<IVillain>(joker).Named("joker")); //act Container.Dispose(); //assert Container.Has(typeof (ISuper)).Should().BeFalse(); Container.Has(typeof (IVillain), "joker").Should().BeFalse(); }
public void dealCard() { GameObject card_1 = CardFactory.Instance.getNewCard(); GameObject card_2 = CardFactory.Instance.getNewCard(); GameObject card_3 = CardFactory.Instance.getNewCard(); GameObject[] card = new GameObject[3]; for (int i = 0; i < 3; i++) { card[i] = CardFactory.Instance.getNewCard(); Card c = card[i].GetComponent <Card> (); if (c.GetType() == typeof(Joker)) { Joker j = (Joker)c; j.changeStatus(10, CardType.HEART); } } GameObject game_view = GameObject.FindGameObjectWithTag(ObjectTag.GAME_VIEW); Transform game_view_transform = game_view.transform; card_1.transform.SetParent(game_view_transform); card_1.transform.position = new Vector3(0, 0, 0); card_1.AddComponent <SpriteRenderer>(); if (card_1.GetComponent <Joker> ()) { card_1.GetComponent <SpriteRenderer>().sprite = jocker; } else { card_1.GetComponent <SpriteRenderer>().sprite = card_1_u; } card_2.transform.SetParent(game_view_transform); card_2.AddComponent <SpriteRenderer>(); card_2.transform.position = new Vector3(-1.88f, 0, 0); if (card_2.GetComponent <Joker> ()) { card_2.GetComponent <SpriteRenderer>().sprite = jocker; } else { card_2.GetComponent <SpriteRenderer>().sprite = card_2_u; } card_3.transform.SetParent(game_view_transform); card_3.AddComponent <SpriteRenderer>(); card_3.transform.position = new Vector3(1.57f, 0, 0); if (card_3.GetComponent <Joker> ()) { card_3.GetComponent <SpriteRenderer>().sprite = jocker; } else { card_3.GetComponent <SpriteRenderer>().sprite = card_2_u; } Debug.Log("Card_dealed"); }
public Card(Joker joker) { this.Joker = joker; }