コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Bedroom bedroom = db.Bedrooms.Find(id);

            db.Bedrooms.Remove(bedroom);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> CreateBedroomAsync(Bedroom br)
        {
            var mapped = _mapper.Map <DAL.Entities.Bedroom>(br);

            await _roomService.AddRoomAsync(mapped);

            return(CreatedAtRoute("GetRoomById", new { id = mapped.Id }, mapped));
        }
コード例 #3
0
ファイル: BetroomAction.cs プロジェクト: itsMaS/gamma
 public override void Initialize(AreaRoom parent, AreaAction child)
 {
     base.Initialize(parent, child);
     room = parent as Bedroom;
     if (!room)
     {
         Debug.LogError("Action is placed in the wrong room! [Not bedroom]");
     }
 }
コード例 #4
0
    public static void Main()
    {
        // Demonstrate classes:
        Console.WriteLine("Defined Classes:");
        Room          room1          = new Room();
        Kitchen       kitchen1       = new Kitchen();
        Bedroom       bedroom1       = new Bedroom();
        Guestroom     guestroom1     = new Guestroom();
        MasterBedroom masterbedroom1 = new MasterBedroom();

        Type room1Type          = room1.GetType();
        Type kitchen1Type       = kitchen1.GetType();
        Type bedroom1Type       = bedroom1.GetType();
        Type guestroom1Type     = guestroom1.GetType();
        Type masterbedroom1Type = masterbedroom1.GetType();

        Console.WriteLine("room assignable from kitchen: {0}", room1Type.IsAssignableFrom(kitchen1Type));
        Console.WriteLine("bedroom assignable from guestroom: {0}", bedroom1Type.IsAssignableFrom(guestroom1Type));
        Console.WriteLine("kitchen assignable from masterbedroom: {0}", kitchen1Type.IsAssignableFrom(masterbedroom1Type));

        // Demonstrate arrays:
        Console.WriteLine();
        Console.WriteLine("Integer arrays:");

        int[] array2  = new int[2];
        int[] array10 = new int[10];
        int[,] array22 = new int[2, 2];
        int[,] array24 = new int[2, 4];

        Type array2Type  = array2.GetType();
        Type array10Type = array10.GetType();
        Type array22Type = array22.GetType();
        Type array24Type = array24.GetType();

        Console.WriteLine("int[2] assignable from int[10]: {0}", array2Type.IsAssignableFrom(array10Type));
        Console.WriteLine("int[2] assignable from int[2,4]: {0}", array2Type.IsAssignableFrom(array24Type));
        Console.WriteLine("int[2,4] assignable from int[2,2]: {0}", array24Type.IsAssignableFrom(array22Type));

        // Demonstrate generics:
        Console.WriteLine();
        Console.WriteLine("Generics:");

        // Note that "int?[]" is the same as "Nullable<int>[]"
        int?[]      arrayNull  = new int?[10];
        List <int>  genIntList = new List <int>();
        List <Type> genTList   = new List <Type>();

        Type arrayNullType  = arrayNull.GetType();
        Type genIntListType = genIntList.GetType();
        Type genTListType   = genTList.GetType();

        Console.WriteLine("int[10] assignable from int?[10]: {0}", array10Type.IsAssignableFrom(arrayNullType));
        Console.WriteLine("List<int> assignable from List<Type>: {0}", genIntListType.IsAssignableFrom(genTListType));
        Console.WriteLine("List<Type> assignable from List<int>: {0}", genTListType.IsAssignableFrom(genIntListType));

        Console.ReadLine();
    }
コード例 #5
0
        public void AddBedroomAuctions(string nameText, string used, double price)
        {
            Bedroom newBedroom = new Bedroom();

            newBedroom.Name     = nameText;
            newBedroom.Price    = price;
            newBedroom.Category = Category.BedRoom;
            newBedroom.ItemUsed = used;
            auctionList.Add(newBedroom);
        }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "Id,BedroomNumber,AvailabilityStatus,BedroomTypeId")] Bedroom bedroom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bedroom).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BedroomTypeId = new SelectList(db.BedRoomTypes, "Id", "BedRoomTypeCode", bedroom.BedroomTypeId);
     return(View(bedroom));
 }
コード例 #7
0
        public ActionResult Create([Bind(Include = "Id,BedroomNumber,AvailabilityStatus,BedroomTypeId")] Bedroom bedroom)
        {
            if (ModelState.IsValid)
            {
                db.Bedrooms.Add(bedroom);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BedroomTypeId = new SelectList(db.BedRoomTypes, "Id", "BedRoomTypeCode", bedroom.BedroomTypeId);
            return(View(bedroom));
        }
コード例 #8
0
        // GET: Bedrooms/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bedroom bedroom = db.Bedrooms.Find(id);

            if (bedroom == null)
            {
                return(HttpNotFound());
            }
            return(View(bedroom));
        }
コード例 #9
0
        public async Task InsertAsync(/*Order order*/)
        {
            var room = new Shower {
                Price = 200
            };

            _context.Rooms.Add(room);
            var room2 = new Bedroom {
                Price = 100
            };

            _context.Rooms.Add(room2);
            var room3 = new Bedroom {
                Price = 100
            };

            _context.Rooms.Add(room3);


            _context.Add(new Order
            {
                Costumer = new Costumer {
                    Name = "nevem"
                },
                StartDate  = DateTime.Now.AddDays(-5),
                EndDate    = DateTime.Now.AddDays(1),
                OrderRooms = new List <OrderRoom>
                {
                    new OrderRoom {
                        Room = room, Note = "megrendeles"
                    },
                    new OrderRoom {
                        Room = room2, Note = "megrendeles"
                    },
                    new OrderRoom {
                        Room = room3, Note = "megrendeles "
                    }
                },
                Price = (room.Price + room2.Price + room3.Price) * 6
            });

            await _context.SaveChangesAsync();

            //var foglalasi_szobak = order.Rooms.Select(r => r.Id).ToList();

            //var marFoglalva = await _context.Orders.AnyAsync(o => o.Rooms.Any(r => foglalasi_szobak.Contains(r.Id)));
            //var roomId = 7;
            //var szabad = _context.Rooms.Where(r => r.Id == roomId && r.OrderRooms.Any(or => or.Order.EndDate < DateTime.Now ))
        }
コード例 #10
0
        // GET: Bedrooms/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bedroom bedroom = db.Bedrooms.Find(id);

            if (bedroom == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BedroomTypeId = new SelectList(db.BedRoomTypes, "Id", "BedRoomTypeCode", bedroom.BedroomTypeId);
            return(View(bedroom));
        }
コード例 #11
0
    public void newRoom()
    {
        int randomRoom = Random.Range(0, 5);

        switch (randomRoom)
        {
        case 0:
            // Another corridor
            // Instantiate and generate the corridor
            corridorInstance = Instantiate(corridorPrefab).GetComponent <Corridor> ();
            corridorInstance.Generate();
            // Put putin in it
            putPutinInRoom(corridorInstance);
            break;

        case 1:
            // Instantiate
            conferenceRoomInstance = Instantiate(conferenceRoomPrefab).GetComponent <ConferenceRoom>();
            // Put putin in it
            putPutinInRoom(conferenceRoomInstance);
            break;

        case 2:
            // Instantiate
            barInstance = Instantiate(barPrefab).GetComponent <Bar> ();
            // Put putin in it
            putPutinInRoom(barInstance);
            break;

        case 3:
            // Instantiate
            bedroomInstance = Instantiate(bedroomPrefab).GetComponent <Bedroom> ();
            // Put putin in it
            putPutinInRoom(bedroomInstance);
            break;

        case 4:
            // Instantiate
            poolInstance = Instantiate(poolPrefab).GetComponent <Pool> ();
            // Put putin in it
            putPutinInRoom(poolInstance);
            break;
        }
    }
コード例 #12
0
ファイル: ReservationService.cs プロジェクト: cSebR/resotel
        public int ChangeBedroomStatus(Bedroom bedroom)
        {
            if (OpenConnection() == false)
            {
                return(0);
            }

            string       req          = "UPDATE bedroom SET state = @state, date_last_clean = @dateLastClean WHERE id = @id";
            MySqlCommand mySqlCommand = new MySqlCommand(req, mySqlConnection);

            mySqlCommand.Parameters.Add(new MySqlParameter("@state", bedroom.State));
            mySqlCommand.Parameters.Add(new MySqlParameter("@dateLastClean", bedroom.DateLastClean));
            mySqlCommand.Parameters.Add(new MySqlParameter("@id", bedroom.Id));
            int res = mySqlCommand.ExecuteNonQuery();

            CloseConnection();

            return(bedroom.Id);
        }
コード例 #13
0
        static void Main(string[] args)
        {
            var mbr = new MasterBedroom()
            {
                Length = 10, Width = 12
            };
            var br = new Bedroom()
            {
                Length = 14, Width = 8
            };

            //Reflections
            //Console.WriteLine(mbr.GetType().ToString());
            //Console.WriteLine(typeof(MasterBedroom).ToString());

            //IsSubClassOf() - Allows you to determine whether a class inherits
            //from a parent (or grandparent) class.

            //true
            //Console.WriteLine(typeof(Kitchen).IsSubclassOf(typeof(Room)));
            //Console.WriteLine(typeof(MasterBedroom).IsSubclassOf(typeof(Bedroom)));
            //Console.WriteLine(typeof(MasterBedroom).IsSubclassOf(typeof(Room)));

            //false
            //Console.WriteLine(typeof(MasterBedroom).IsSubclassOf(typeof(Kitchen)));
            //Console.WriteLine(mbr.GetType().IsSubclassOf(typeof(Kitchen)));


            //IsInstanceOfType() - Same idea, but allows you to work with instances of classes

            //Console.WriteLine(typeof(MasterBedroom).IsInstanceOfType(mbr)); //true

            //Console.WriteLine(typeof(Bedroom).IsInstanceOfType(mbr)); //true
            //Console.WriteLine(typeof(Kitchen).IsInstanceOfType(mbr)); // false


            //IsAssignableFrom() - Determines whether an instance of a specified type can be
            //assigned to an instance of the current type

            //Console.WriteLine(typeof(MasterBedroom).IsAssignableFrom(typeof(Bedroom))); //false
            //Console.WriteLine(typeof(Bedroom).IsAssignableFrom(typeof(MasterBedroom))); //true
        }
コード例 #14
0
        static void Main(string[] args)
        {
            Room kitchen = new Kitchen {
                Area = 5
            };
            Room bedroom = new Bedroom {
                Area = 10
            };
            Room livingRoom = new Room {
                Area = 20
            };

            List <Room> rooms = new List <Room> {
                kitchen, bedroom, livingRoom
            };

            Building building = new Building(rooms);

            building.ThresholdReached     += (sender, e) => { Console.WriteLine(e.CurrentArea); };
            building.BuildingConstructing += (sender, e) => { e.Rooms.Add(kitchen); };

            Building house  = new House(rooms, 10);
            Building office = new Office(new List <Room> {
                kitchen, bedroom, kitchen, livingRoom, livingRoom
            }, 12);

            List <Building> buildings = new List <Building> {
                building, house, office
            };

            double totalArea = 0;

            foreach (var b in buildings)
            {
                totalArea += b.Area;
            }

            Console.WriteLine("house's area: {0}", house.Area);
            Console.WriteLine("office's area: {0}", office.Area);
            Console.WriteLine("building's area: {0}", building.Area);
            Console.WriteLine("All buildings' total area: {0}", totalArea);
        }
コード例 #15
0
    public void newRoom()
    {
        int randomRoom = Random.Range (0, 5);

        switch (randomRoom) {
        case 0:
            // Another corridor
            // Instantiate and generate the corridor
            corridorInstance = Instantiate (corridorPrefab).GetComponent<Corridor> ();
            corridorInstance.Generate ();
            // Put putin in it
            putPutinInRoom (corridorInstance);
            break;
        case 1:
            // Instantiate
            conferenceRoomInstance = Instantiate (conferenceRoomPrefab).GetComponent<ConferenceRoom>();
            // Put putin in it
            putPutinInRoom (conferenceRoomInstance);
            break;
        case 2:
            // Instantiate
            barInstance = Instantiate (barPrefab).GetComponent<Bar> ();
            // Put putin in it
            putPutinInRoom (barInstance);
            break;
        case 3:
            // Instantiate
            bedroomInstance = Instantiate (bedroomPrefab).GetComponent<Bedroom> ();
            // Put putin in it
            putPutinInRoom (bedroomInstance);
            break;
        case 4:
            // Instantiate
            poolInstance = Instantiate (poolPrefab).GetComponent<Pool> ();
            // Put putin in it
            putPutinInRoom (poolInstance);
            break;
        }
    }
コード例 #16
0
ファイル: ReservationService.cs プロジェクト: cSebR/resotel
        public List <Bedroom> ChargerAllBedroomToClean()
        {
            List <Bedroom> list = new List <Bedroom>();

            if (OpenConnection() == false)
            {
                return(list);
            }

            string req = "UPDATE bedroom LEFT JOIN link_reservationbedroomoptions ON bedroom.id = link_reservationbedroomoptions.id_Bedroom LEFT JOIN reservation ON link_reservationbedroomoptions.id_Reservation = reservation.id SET bedroom.state = 'Non nettoyé' WHERE(TO_DAYS(now()) - TO_DAYS(bedroom.date_last_clean)) > 3 OR reservation.dateEnd = NOW(); " +

                         "SELECT bedroom.id, bedroom.number, bedroom.state, bedroom.date_last_clean, typebedroom.id AS typeId, typebedroom.name, typebedroom.price FROM bedroom JOIN typebedroom ON bedroom.id_TypeBedroom = typebedroom.id WHERE bedroom.state = 'Non nettoyé' ;";
            MySqlCommand    mySqlCommand = new MySqlCommand(req, mySqlConnection);
            MySqlDataReader reader2      = mySqlCommand.ExecuteReader();

            while (reader2.Read())
            {
                Bedroom bedroom = new Bedroom
                {
                    Id            = reader2.GetInt32("id"),
                    Number        = reader2.GetInt32("number"),
                    State         = reader2.GetString("state"),
                    DateLastClean = reader2.GetDateTime("date_last_clean"),
                    TypeBedroom   = new TypeBedroom
                    {
                        Id    = reader2.GetInt32("typeId"),
                        Name  = reader2.GetString("name"),
                        Price = reader2.GetFloat("price")
                    }
                };

                list.Add(bedroom);
            }

            CloseConnection();

            return(list);
        }
コード例 #17
0
        static void Main(string[] args)
        {
            Console.Title = "Morrigan's Curse";
            Console.Clear();
            Console.WriteLine(@"'What have we here?' A woman's voice asks coldly.
'A new plaything?'
'What is your name?'");
            string name      = Console.ReadLine();
            bool   standing  = false;
            Player newPlayer = new Player(name, standing);

            Console.Clear();
            Console.WriteLine($@"'{newPlayer.Name}...'
'You'll join the others.'");
            Console.ReadKey();
            Console.Clear();
            Console.WriteLine(@"You wake up in a small room, laying on a bed barely large enough to fit you. 
As far you can tell there is nothing else in the room besides a door directly in front of you.
What would you like to do?");
            Bedroom game = new Bedroom(newPlayer);

            game.Start();
        }
コード例 #18
0
        static void Main(string[] args)
        {
            //PassByReferenceDemo.RunTest();

            // Tamagotichi
            //
            // Kunna mata tamag.
            // Rasta.
            // Städa efter den.
            // Trösta den om den är ledsen.
            // Leka.
            // ...☠️
            // Flytta den mellan olika områden
            // Lekplats, Sovrum, Resturang
            List <Tamagotchi> gotchis = new List <Tamagotchi>();
            Room testRoom             = new Bedroom();

            gotchis.Add(new YellowGotchi(testRoom));
            gotchis.Add(new RedGotchi());

            foreach (Tamagotchi tama in gotchis)
            {
                tama.Wait();

                if (tama.Dead)
                {
                    Console.WriteLine("Dog");
                }
                else
                {
                    if (tama.Hungry)
                    {
                        Console.WriteLine("Är hungrig");
                    }
                }
            }
        }
コード例 #19
0
ファイル: ReservationService.cs プロジェクト: cSebR/resotel
        public List <Bedroom> ChargerBedroomByReservation(int id)
        {
            List <Bedroom> list = new List <Bedroom>();

            if (OpenConnection() == false)
            {
                return(list);
            }

            string          req          = "SELECT bedroom.id, bedroom.number, bedroom.state, bedroom.date_last_clean, typebedroom.id AS typeId, typebedroom.name, typebedroom.price FROM bedroom, typebedroom, link_reservationbedroomoptions WHERE link_reservationbedroomoptions.id_Reservation = " + id + " AND link_reservationbedroomoptions.id_Bedroom = bedroom.id AND bedroom.id_TypeBedroom = typebedroom.id GROUP BY id_Bedroom";
            MySqlCommand    mySqlCommand = new MySqlCommand(req, mySqlConnection);
            MySqlDataReader reader2      = mySqlCommand.ExecuteReader();

            while (reader2.Read())
            {
                Bedroom bedroom = new Bedroom
                {
                    Id            = reader2.GetInt32("id"),
                    Number        = reader2.GetInt32("number"),
                    State         = reader2.GetString("state"),
                    DateLastClean = reader2.GetDateTime("date_last_clean"),
                    TypeBedroom   = new TypeBedroom
                    {
                        Id    = reader2.GetInt32("typeId"),
                        Name  = reader2.GetString("name"),
                        Price = reader2.GetFloat("price")
                    }
                };

                list.Add(bedroom);
            }

            CloseConnection();

            return(list);
        }
コード例 #20
0
ファイル: ReservationService.cs プロジェクト: cSebR/resotel
        public List <Bedroom> ChargerAllAvailableBedroom()
        {
            List <Bedroom> list = new List <Bedroom>();

            if (OpenConnection() == false)
            {
                return(list);
            }

            string          req          = "SELECT bedroom.id, bedroom.number, bedroom.state, bedroom.date_last_clean, typebedroom.id AS typeId, typebedroom.name, typebedroom.price FROM bedroom JOIN typebedroom ON bedroom.id_TypeBedroom = typebedroom.id LEFT JOIN link_reservationbedroomoptions ON bedroom.id = link_reservationbedroomoptions.id_Bedroom LEFT JOIN reservation ON link_reservationbedroomoptions.id_Reservation = reservation.id WHERE link_reservationbedroomoptions.id_Bedroom IS NULL OR NOW() NOT BETWEEN reservation.dateStart AND reservation.dateEnd ORDER BY bedroom.id ASC";
            MySqlCommand    mySqlCommand = new MySqlCommand(req, mySqlConnection);
            MySqlDataReader reader2      = mySqlCommand.ExecuteReader();

            while (reader2.Read())
            {
                Bedroom bedroom = new Bedroom
                {
                    Id            = reader2.GetInt32("id"),
                    Number        = reader2.GetInt32("number"),
                    State         = reader2.GetString("state"),
                    DateLastClean = reader2.GetDateTime("date_last_clean"),
                    TypeBedroom   = new TypeBedroom
                    {
                        Id    = reader2.GetInt32("typeId"),
                        Name  = reader2.GetString("name"),
                        Price = reader2.GetFloat("price")
                    }
                };

                list.Add(bedroom);
            }

            CloseConnection();

            return(list);
        }
コード例 #21
0
ファイル: ReservationService.cs プロジェクト: cSebR/resotel
        public List <Bedroom> ChargerAllBedroom()
        {
            List <Bedroom> list = new List <Bedroom>();

            if (OpenConnection() == false)
            {
                return(list);
            }

            string          req          = "SELECT bedroom.id, bedroom.number, bedroom.state, bedroom.date_last_clean, typebedroom.id AS typeId, typebedroom.name, typebedroom.price FROM bedroom JOIN typebedroom ON bedroom.id_TypeBedroom = typebedroom.id";
            MySqlCommand    mySqlCommand = new MySqlCommand(req, mySqlConnection);
            MySqlDataReader reader2      = mySqlCommand.ExecuteReader();

            while (reader2.Read())
            {
                Bedroom bedroom = new Bedroom
                {
                    Id            = reader2.GetInt32("id"),
                    Number        = reader2.GetInt32("number"),
                    State         = reader2.GetString("state"),
                    DateLastClean = reader2.GetDateTime("date_last_clean"),
                    TypeBedroom   = new TypeBedroom
                    {
                        Id    = reader2.GetInt32("typeId"),
                        Name  = reader2.GetString("name"),
                        Price = reader2.GetFloat("price")
                    }
                };

                list.Add(bedroom);
            }

            CloseConnection();

            return(list);
        }
コード例 #22
0
 public void Visit(Bedroom room)
 {
     room.Clean();
 }
コード例 #23
0
ファイル: BedroomViewModel.cs プロジェクト: cSebR/resotel
 public BedroomViewModel(Bedroom bedroom)
 {
     Bedroom = bedroom;
 }
コード例 #24
0
        protected override void Seed(Hotel_ExtContext context)
        {
            HotelsInfo h = new HotelsInfo
            {
                Id          = 1,
                Fullname    = "ABC HOTEL",
                Address     = "JL. ABC No.123, Bandung , Jawa Barat",
                Description = "A cozy hotel located in Bandung. Located near green area of Bandung, Lembang. Make this hotel air so refreshing. With affordable price, ABC Hotel offers a great view, a fresh air and first rate service.",
                Stars       = 4
            };

            context.HotelInfo.Add(h);

            UserHotel uh = new UserHotel
            {
                Id          = 1,
                Username    = "******",
                Password    = "******",
                Email       = "*****@*****.**",
                Address     = "sarijadi",
                PhoneNumber = 0222001181
            };

            context.UserHotels.Add(uh);

            BankAccount hotel = new BankAccount
            {
                Id = 1,
                BankAccountName = "Jayakarta",
                BankAccountNo   = "123456",
                BankName        = "BCA"
            };
            BankAccount pelanggan = new BankAccount
            {
                Id = 2,
                BankAccountName = "Bambang",
                BankAccountNo   = "78910",
                BankName        = "BCA",
                UserHotelId     = 1
            };

            context.BankAccounts.Add(hotel);
            context.BankAccounts.Add(pelanggan);

            Facility f = new Facility {
                Id           = 1,
                FacilityNo   = "a1",
                FacilityName = "WIFI"
            };

            context.Facilities.Add(f);

            Room r = new Room
            {
                Id       = 1,
                RoomNo   = "ab123",
                RoomName = "ab123",
                Capacity = "2"
            };

            context.Rooms.Add(r);

            BedRoomType bt = new BedRoomType
            {
                Id = 1,
                BedRoomTypeCode = "d",
                BedRoomName     = "deluxe",
                ImageBedroom    = "xyz",
                SizeRoom        = 50
            };

            context.BedRoomTypes.Add(bt);


            Bedroom b = new Bedroom
            {
                Id                 = 1,
                BedroomNumber      = "abcd123",
                AvailabilityStatus = 1,
                BedroomTypeId      = 1
            };

            context.Bedrooms.Add(b);
            context.SaveChanges();



            base.Seed(context);
        }
コード例 #25
0
 public void Visit(Bedroom room)
 {
     this.ServiceCost += BedroomPrice;
 }
コード例 #26
0
ファイル: TestSuite.cs プロジェクト: karterfree/CUnit
        public void Test()
        {
            object t = null;
            Assert.Should(t).BeEqual(string.Empty);

            string s = "";

            Assert.Should(t).NotBeEqual(string.Empty);
            bool b1 = true;
            Assert.Should(b1).BeTrue();

            int i1 = 8;
            Assert.Should(i1).BeNull();

            int i2 = 8;
            int? i3 = null;
            Assert.Should(i3).BeEqual(i2);

            object t2 = null;
            object t3 = null;
            Assert.Should(t2).BeEqual(t3);

            Assert.Should().Throw<OutOfMemoryException>(() => {

            });

            Assert.Should().Throw<OutOfMemoryException>(() => {
                throw new OutOfMemoryException();
            });

            Assert.Should().NotThrow(() => {

            });

            Assert.Should().NotThrow(() => {
                throw new OutOfMemoryException();
            });

            var room = new Room();
            var kitchen = new Kitchen();
            var bedroom = new Bedroom();
            var guestroom = new Guestroom();
            var masterBedroom = new MasterBedroom();
            Assert.Should(room).BeInstanceOf(typeof(Room));
            Assert.Should(room).BeInstanceOf(typeof(Kitchen));
            Assert.Should(kitchen).BeInstanceOf(typeof(Room));
            Assert.Should(kitchen).BeInstanceOf(typeof(Kitchen));
            Assert.Should(bedroom).BeInstanceOf(typeof(Room));
            Assert.Should(bedroom).BeInstanceOf(typeof(Bedroom));
            Assert.Should(bedroom).BeInstanceOf(typeof(Kitchen));
            Assert.Should(guestroom).BeInstanceOf(typeof(Room));
            Assert.Should(guestroom).BeInstanceOf(typeof(Bedroom));
            Assert.Should(guestroom).BeInstanceOf(typeof(Guestroom));
            Assert.Should(guestroom).BeInstanceOf(typeof(MasterBedroom));
            Assert.Should(masterBedroom).BeInstanceOf(typeof(Room));
            Assert.Should(masterBedroom).BeInstanceOf(typeof(Guestroom));

            Room room1 = null;
            Room room2 = new Room();
            Assert.Should(room1).BeNull();
            Assert.Should(room2).BeNull();
            Assert.Should(room1).NotBeNull();
            Assert.Should(room2).NotBeNull();
            Assert.Should(1).NotBeNull();

            Assert.Should("").NotBeNull();
        }
コード例 #27
0
 public void Visit(Bedroom room)
 {
     return;
 }
コード例 #28
0
        public Tamagotchi()
        {
            Room startingRoom = new Bedroom();

            SetUpTamagotchi(startingRoom);
        }
コード例 #29
0
    void Start()
    {
        //Check if Vive detected and enable/disable the appropriate things
        if (ViveDetected)
        {
            OculusFPC.enabled     = false;
            OculusCC.enabled      = false;
            OculusAS.enabled      = false;
            OculusRaycast.enabled = false;
            OculusCrosshair.SetActive(false);
            SteamVRObject.transform.position = new Vector3(0f, 0f, 0f);
        }
        else if (OculusDetected)
        {
            OculusFPC.enabled     = true;
            OculusCC.enabled      = true;
            OculusAS.enabled      = true;
            OculusRaycast.enabled = true;
            OculusCrosshair.SetActive(true);
            SteamVRObject.transform.position = new Vector3(0f, 0.6f, 0f);

            CharacterController cc = SteamVRObject.GetComponent <CharacterController>();
            cc.height = 1.0f;
        }
        else
        {
            Debug.Log("No Oculus Detected. Going to player mode");

            OculusFPC.enabled     = true;
            OculusCC.enabled      = true;
            OculusAS.enabled      = true;
            OculusRaycast.enabled = true;
            OculusCrosshair.SetActive(true);
            SteamVRObject.transform.position = new Vector3(0f, 0.6f, 0f);

            CharacterController cc = SteamVRObject.GetComponent <CharacterController>();
            cc.height = 3.0f;
        }


        foreach (Text VersionNum in VersionUI)
        {
            VersionNum.text = "VR Model Viewer: " + VersionNumber;
        }

        //Check that the right objects are enabled/disabled on start
        MainMenuUI.SetActive(true);

        LowPolyStage.SetActive(true);
        Bedroom.SetActive(false);
        DarkRoom.SetActive(false);
        JapRoom.SetActive(false);
        ParkingLot.SetActive(false);
        BookersOffice.SetActive(false);

        //All characters disabled on start
        ClaraLille.SetActive(false);
        Quiet.SetActive(false);
        Ciri.SetActive(false);
        Yennefer.SetActive(false);
        Tracer.SetActive(false);
        MadMoxxi.SetActive(false);
        DVa.SetActive(false);
        Widowmaker.SetActive(false);

        Nidalee.SetActive(false);
        Elizabeth.SetActive(false);
        Triss.SetActive(false);
        HarleyQuinn.SetActive(false);
        JillValentine.SetActive(false);
        LaraToO.SetActive(false);
        Jack.SetActive(false);
        JulietStarling.SetActive(false);

        foreach (GameObject obj in DisableUIScreens)
        {
            obj.SetActive(false);
        }

        //Set all UI values to 0
        ClaraRotationSlider.value     = 0f;
        QuietRotationSlider.value     = 0f;
        CiriRotationSlider.value      = 0f;
        YenneferRotationSlider.value  = 0f;
        TracerRotationSlider.value    = 0f;
        MoxxiRotationSlider.value     = 0f;
        DVaRotSlider.value            = 0f;
        NidaleeRotSlider.value        = 0f;
        ElizabethRotSlider.value      = 0f;
        TrissRotSlider.value          = 0f;
        HarleyQuinnRotSlider.value    = 0f;
        JillValentineRotSlider.value  = 0f;
        LaraToORotSlider.value        = 0f;
        JackRotSlider.value           = 0f;
        JulietStarlingRotSlider.value = 0f;
        WidowmakerRotSlider.value     = 0f;

        //Change scale values once you know the right ones
        ClaraScaleSlider.value          = 0.23f;
        QuietScaleSlider.value          = 0.23f;
        CiriScaleSlider.value           = 0.23f;
        YenneferScaleSlider.value       = 0.23f;
        TracerScaleSlider.value         = 0.23f;
        MoxxiScaleSlider.value          = 0.23f;
        DVaScaleSlider.value            = 0.23f;
        NidaleeScaleSlider.value        = 0.23f;
        ElizabethScaleSlider.value      = 0.23f;
        TrissScaleSlider.value          = 0.23f;
        HarleyQuinnScaleSlider.value    = 0.23f;
        JillValentineScaleSlider.value  = 0.23f;
        LaraToOScaleSlider.value        = 0.23f;
        JackScaleSlider.value           = 0.23f;
        JulietStarlingScaleSlider.value = 0.23f;
        WidowmakerScaleSlider.value     = 0.23f;
    }
コード例 #30
0
 public void Visit(Bedroom room)
 {
     // Does nothing here
 }