Exemplo n.º 1
0
        public void SpeedCamelAnswerTest()
        {
            var magicCarpet     = new MagicCarpet();
            var mortar          = new Mortar();
            var broom           = new Broom();
            var camel           = new BactrianCamel();
            var speedCamel      = new SpeedCamel();
            var centaur         = new Centaur();
            var allTerrainBoots = new AllTerrainBoots();

            var vehicles = new List <Vehicle>
            {
                magicCarpet,
                mortar,
                broom,
                camel,
                speedCamel,
                centaur,
                allTerrainBoots
            };

            var race   = new Race <Vehicle>(1000, vehicles);
            var winner = race.RunRace();

            Assert.AreEqual("SpeedCamel", winner.GetType().Name);
        }
Exemplo n.º 2
0
        public void TestAir()
        {
            //arrange


            //act
            string           expected = "MeAir";
            Transport        ts6      = new Broom("Метла", 20);
            Transport        ts7      = new FlyCarpet("Ковер-самолет", 10);
            Transport        ts8      = new Mortar("Ступа", 8);
            Transport        ts9      = new MyAir("MeAir", 100, 50);
            List <Transport> ts       = new List <Transport>();

            ts.Add(ts6);
            ts.Add(ts7);
            ts.Add(ts8);
            ts.Add(ts9);

            Race <Transport> race   = new Race <Transport>(1000, ts);
            Transport        first  = race.Champion();
            string           actual = first.Name;

            Assert.AreEqual(expected, actual);
            //assert ожидали - получили
        }
Exemplo n.º 3
0
 private void ButtonClear_Click(object sender, RoutedEventArgs e)
 {
     if (radioCleanerBrowser.IsChecked == true)
     {
         Broom.CleanerBrowser();
     }
     else if (radioCleanerDownloads.IsChecked == true)
     {
         Broom.CleanerDownloads();
     }
     else if (radioCleanerRecile.IsChecked == true)
     {
         Broom.CleanerRecile();
     }
     else if (radioCleanerBrowserAndDownloads.IsChecked == true)
     {
         Broom.CleanerBrowser();
         Broom.CleanerDownloads();
     }
     else if (radioCleanerBrowserAndRecile.IsChecked == true)
     {
         Broom.CleanerBrowser();
         Broom.CleanerRecile();
     }
     else if (radioCleanerRecileAndDownloads.IsChecked == true)
     {
         Broom.CleanerRecile();
         Broom.CleanerDownloads();
     }
     else if (radioCleanerAll.IsChecked == true)
     {
         Broom.CleanerAll();
     }
 }
Exemplo n.º 4
0
        public void Broomtest()
        {
            Broom broom    = new Broom();
            var   actual   = broom.calc(800);
            var   expented = 40;

            Assert.AreEqual(expented, actual);
        }
Exemplo n.º 5
0
        private void GetHit(Broom b)
        {
            SoundManager.PlaySoundEffect("hit_slime");

            goos.Spawn(g => g.Spawn(this), 2);

            _health -= 1;
            velocity = FacingDirection(b.facing) * 100;

            state.ChangeState("Hurt");
        }
Exemplo n.º 6
0
        public DustIcon(Vector2 pos, Broom broom)
            : base(pos, "DustUI", 9, 9, DrawOrder.DUST_ICON)
        {
            AddAnimation("empty", CreateAnimFrameArray(0, 1, 2, 3, 4), 13, false);
            AddAnimation("full", CreateAnimFrameArray(4, 3, 2, 1, 0), 13, false);
            AddAnimation("default", CreateAnimFrameArray(4), 0, false);

            Play("default");

            _broom = broom;
        }
Exemplo n.º 7
0
        public UserControl2(ExternalCommandData revit)
        {
            InitializeComponent();
            tbSettingText.Text = Settings.Default["names"].ToString();

            //wins.Name = "txt";
            wins.ShowDialog();
            Broom broom = new Broom();

            if (com == true)
            {
                broom.Analyze(revit);
            }
        }
Exemplo n.º 8
0
        public void Test1()
        {
            var broom     = new Broom();
            var plane     = new Plane();
            var stupa     = new Stupa();
            var airRacers = new List <AirTransport>()
            {
                broom, plane, stupa
            };
            var airRace   = new AirRace(5000, airRacers);
            var airWinner = airRace.GetWinner();

            Assert.AreEqual(broom, airWinner);
        }
Exemplo n.º 9
0
        public void Test3()
        {
            var broom           = new Broom();
            var plane           = new Plane();
            var stupa           = new Stupa();
            var dblHumpedCamell = new DblHumpedCamell();
            var fastCamell      = new FastCamell();
            var boots           = new Boots();
            var kent            = new Kentavr();
            var racers          = new List <Transport>()
            {
                boots, kent, fastCamell, dblHumpedCamell, broom, plane, stupa
            };
            var commonRace = new Race(10000, racers);
            var winner     = commonRace.GetWinner();

            Assert.AreEqual(broom, winner);
        }
Exemplo n.º 10
0
        public void BroomAnswerTest()
        {
            var magicCarpet = new MagicCarpet();
            var mortar      = new Mortar();
            var broom       = new Broom();

            var vehicles = new List <AirVehicle>
            {
                magicCarpet,
                mortar,
                broom
            };

            var race   = new Race <AirVehicle>(1000, vehicles);
            var winner = race.RunRace();

            Assert.AreEqual("Broom", winner.GetType().Name);
        }
Exemplo n.º 11
0
 virtual protected void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Snitch")
     {
         try
         {
             Team.Score();
         }
         catch (NullReferenceException)
         {
             /* Another bug where spread brooms are calling this method even though it's overridden.*/
         }
     }
     if (collision.gameObject.tag == "Player")
     {
         Broom other = collision.gameObject.GetComponent <SpreadBroom>();
         if (other == null)
         {
             other = collision.gameObject.GetComponent <Broom>();
         }
         try
         {
             if (other.teamNum != teamNum)
             {
                 if (falling || Random.Range(0f, 1f) < Team.TackleProbability)
                 {
                     other.Hit();
                 }
             }
         }
         catch (NullReferenceException)
         {
             /* Wierd bug where collision triggers on new broom before start, so no team is set yet. Ignoring.*/
         }
     }
     if (collision.gameObject.tag == "Ground" && falling)
     {
         falling = false;
         GameObject child = Instantiate(this.gameObject, this.transform.parent);
         child.name = this.name;
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 12
0
        public void AirEarthRacetest()
        {
            Centaur          cen            = new Centaur();
            Two_humped_Camel twoHumpedCamel = new Two_humped_Camel();
            Magiccarpet      carpet         = new Magiccarpet();
            Mortar           mortar         = new Mortar();
            Broom            broom          = new Broom();
            Bootsalltrains   boot           = new Bootsalltrains();
            CamelSpeedBoat   camelspped     = new CamelSpeedBoat();
            AirEarthRace     race           = new AirEarthRace(new List <EarthTransport> {
                cen, camelspped, twoHumpedCamel, boot
            }, new List <AirTransport> {
                carpet, broom, mortar
            });
            var actual   = race.calc(100);
            var expented = "CamelSppedBoat";

            Assert.AreEqual(expented, actual);
        }
Exemplo n.º 13
0
        public void TestLandAndAir()
        {
            //arrange


            //act
            string    expected = "MeAir";
            Transport ts1      = new Bactrian("Двугорбый верблюд", 10, 30);
            Transport ts2      = new AllTerainBoots("Ботинки-вездеходы", 6, 60);
            Transport ts3      = new CamelSpeedBoat("Верблюд-быстроход", 40, 10);
            Transport ts4      = new Centaur("Кентавр", 15, 8);
            Transport ts5      = new MyLand("MeLand", 10, 10, 5);
            Transport ts6      = new Broom("Метла", 20);
            Transport ts7      = new FlyCarpet("Ковер-самолет", 10);
            Transport ts8      = new Mortar("Ступа", 8);
            Transport ts9      = new MyAir("MeAir", 100, 50);

            List <Transport> ts = new List <Transport>();

            ts.Add(ts1);
            ts.Add(ts2);
            ts.Add(ts3);
            ts.Add(ts4);
            ts.Add(ts5);
            ts.Add(ts6);
            ts.Add(ts7);
            ts.Add(ts8);
            ts.Add(ts9);

            Race <Transport> race   = new Race <Transport>(1000, ts);
            Transport        first  = race.Champion();
            string           actual = first.Name;

            Assert.AreEqual(expected, actual);
            //assert ожидали - получили
        }
Exemplo n.º 14
0
        public WorldBuilder()
        {
            // Create Rooms
            var room1 = new StartRoom(
                "The Room",
                "I'm inside a small room with bad lighting, I can see a door, maybe I can open it?",
                "There's a key and a note on the ground!");

            var room2 = new Hallway(
                "Hallway",
                "A small hallway with cement covered walls, the air is damp. I think I'm in a cellar?\n" +
                "There is a path leading to the left, it looks dark. There's also a path leading to the right.",
                "");

            var room3Right = new JanitorsRoom(
                "Janitor's Room",
                "It's a small room, quite messy, it smells like gasoline. I see a painting of an old man with a handle bar mustasch.\n" +
                "I can't see any exits here besides the way I came from.",
                "");

            var room4Left = new FinalRoom(
                "Final Room",
                "It's a small room with walls covered in moist, I can see a door with a codelock next to it.",
                "There's nothing here except the door...");

            // Create Items
            var roomKey = new Item(
                "Room Key",
                "It looks like it could fit to this door.",
                1,
                "The key is old and rusty, it looks fragile.");

            var note = new Note(
                "Note",
                "A piece of paper with something written on it.",
                0,
                "A piece of paper with something written on it.");

            var bottle = new Bottle(
                "Bottle of Kerosene",
                "It's commonly used to power jet engines.",
                2,
                "A bottle of kerosene, it's very flammable.");

            var rags = new Rags(
                "Rags",
                "Some old clothes ripped apart.",
                2,
                "I think this used to be a shirt...");

            var broom = new Broom(
                "Broom",
                "A regular broom used to cleaning.",
                5, "It's a broom, what more do you need to know?");

            var painting = new Item(
                "Painting",
                "A painting of Mr.X?",
                0,
                "The painting is signed by Mr X." +
                " There seems to be missing a piece of the painting.",
                false);

            var rocks = new Rock(
                "Pile of Rocks",
                "It's a pile of rocks.",
                7,
                "A large pile of small rocks, almost as someone placed them there? Maybe I can move them.",
                false);


            // Create Exit Points
            var roomExit = new Door(
                room2,
                1,
                true,
                false,
                "Rooms Door",
                "You hear a crack... the door is unlocked! Oh... the key broke in half.",
                "The door is locked, maybe there's a key somewhere?",
                "A brown wooden door with a sturdy lock.");

            var room2RightExit = new RightOfHallway(
                room3Right,
                2,
                false,
                false,
                "Right",
                "",
                "",
                ""
                );

            var room2LeftExit = new LeftOfHallway(
                room4Left,
                10,
                true,
                false,
                "Left",
                "Finally some light! I can now see where I'm going.",
                "I can't go that way, it's too dark. I need some light...",
                "It's just a dark passage..."
                );

            var finalRoomExit = new FinalDoor(
                11,
                true,
                false,
                "Codelock Door",
                "Success! The door is unlocked, let's get out of here!",
                "The door is locked. There's a codelock to it. I need to find that code!",
                "A big iron door with a codelock next to it."
                );

            // Add exits to room sists
            room1.Exit.Add(roomExit);
            room2.Exit.Add(new Door(
                               room1,
                               1,
                               false,
                               false,
                               "Rooms Door",
                               "",
                               "",
                               "That's the door I came from. The key is still stuck inside the lock, whoops!"));
            room2.Exit.Add(room2RightExit);
            room2.Exit.Add(room2LeftExit);

            room3Right.Exit.Add(new Exit(
                                    room2,
                                    2,
                                    false,
                                    false,
                                    "Left",
                                    "",
                                    "",
                                    ""));

            room4Left.Exit.Add(new Exit
                                   (room2,
                                   2,
                                   false,
                                   false,
                                   "Right",
                                   "",
                                   "",
                                   ""));
            room4Left.Exit.Add(finalRoomExit);

            // Add items to room inventory
            room1.RoomInventory.Add(roomKey);
            room1.RoomInventory.Add(note);

            room2.RoomInventory.Add(rocks);

            room3Right.RoomInventory.Add(bottle);
            room3Right.RoomInventory.Add(rags);
            room3Right.RoomInventory.Add(broom);
            room3Right.RoomInventory.Add(painting);

            // Add all instances of rooms to property Rooms
            Rooms.Add(room1);
            Rooms.Add(room2);
            Rooms.Add(room3Right);
        }
Exemplo n.º 15
0
    public Character(Characterclass c, string name, int lvl = 0)
    {
        inventory = new Items[4];
        switch (c)
        {
        case Character.Characterclass.COUNT:
            stats = new int[] { 20, 20, 35, 20, 35, 10 };
            Calc c = new Calc("TI 83+");
            inventory[0] = c;
            break;

        case Character.Characterclass.GUARD:
            stats = new int[] { 45, 15, 45, 0, 15, 10 };
            Stick st = new Stick("Basic stick");
            inventory[0] = st;
            break;

        case Character.Characterclass.ING:
            stats = new int[] { 25, 15, 5, 40, 35, 35 };
            Computer co = new Computer("Raspberry Pi 0");
            break;

        case Character.Characterclass.INTER:
            stats = new int[] { 15, 15, 15, 15, 15, 15 };
            break;

        case Character.Characterclass.MAN:
            stats = new int[] { 10, 35, 10, 35, 10, 20 };
            Money m = new Money("just a little bit");
            inventory[0] = m;
            break;

        case Character.Characterclass.PDG:
            stats = new int[] { 10, 5, 10, 5, 10, 10 };
            Money m = new Money("just a little bit");
            inventory[0] = m;
            break;

        case Character.Characterclass.SEC:
            stats = new int[] { 10, 10, 10, 10, 10, 40 };
            Stapler s = new Stapler("Stapler of doom", 0, 5);
            inventory[0] = s;
            break;

        case Character.Characterclass.STAG:
            stats = new int[] { 20, 20, 20, 20, 20, 20 };
            Coffee cof = new Coffee("Nespresso");
            inventory[0] = cof;
            break;

        case Character.Characterclass.TECH:
            stats = new int[] { 15, 45, 5, 0, 20, 45 };
            Broom b = new Broom("Nimbus 2000");
            inventory[0] = b;
            break;

        default:
            stats = new int[] { 25, 25, 25, 25, 25, 25 };
            break;
        }
        for (int i = 0; i < 6; i++)
        {
            stats[i] += Random.Range(-2, 2);
            if (stats[i] < 0)
            {
                stats[i] = 0;
            }
        }
        life     = stats[0];
        maxLife  = life;
        this.lvl = 1;
        atk      = stats[1];
        def      = stats[2];
        matk     = stats[3];
        mdef     = stats[4];
        spd      = stats[5];



        life       = Life;
        maxLife    = life;
        this.c     = c;
        this.lvl   = lvl;
        this.cname = name;
    }
Exemplo n.º 16
0
        private static void Main()
        {
            #region Event
            Broom.Info         += BroomConsole.InfoMessage;
            Broom.Error        += BroomConsole.ErrorMessage;
            Broom.Successfully += BroomConsole.SuccessfullyMessage;

            Broom.Info         += BroomLogFile.InfoMessage;
            Broom.Error        += BroomLogFile.ErrorMessage;
            Broom.Successfully += BroomLogFile.SuccessfullyMessage;
            #endregion

            BroomConsole.PrintWelcome();
            BroomConsole.PrintMenu();

            BroomLogFile.LogFileStart();

            var choice = Convert.ToInt32(ReadLine());

            switch (choice)
            {
            case 1:     // 1. Очистить только кэши браузеров
                Broom.CleanerBrowser();
                break;

            case 2:     // 2. Очитстить только Корзину и временные файлы (RecycleBin & Temp)
                Broom.CleanerRecile();
                break;

            case 3:     // 3. Очитстить только папку Загрузки (Downloads)
                Broom.CleanerDownloads();
                break;

            case 4:     // 4. Очитстить кэши браузеров и Корзину с временными файлами (RecycleBin & Temp)
                Broom.CleanerBrowser();
                Broom.CleanerRecile();
                break;

            case 5:     // 5. Очитстить кэши браузеров и папку Загрузки (Downloads)
                Broom.CleanerBrowser();
                Broom.CleanerDownloads();
                break;

            case 6:     // 6. Очитстить Корзину с временными файлами (RecycleBin & Temp) и папку Загрузки (Downloads)
                Broom.CleanerRecile();
                Broom.CleanerDownloads();
                break;

            case 7:     // 7. Очитстить кэши браузеров, Корзину с временными файлами (RecycleBin & Temp) и папку Загрузки (Downloads)
                Broom.CleanerAll();
                break;

            case 0:     // 0. Выход
                break;

            default:
                WriteLine("Неверный режим работы");
                break;
            }

            BroomLogFile.LogFileEnd();
            ReadKey();
        }
Exemplo n.º 17
0
        public void Broom_Test(Double distance, Double time)
        {
            var broom = new Broom();

            Assert.That(broom.Ride(distance), Is.EqualTo(time));
        }