예제 #1
0
        public async Task <IActionResult> CreateDayRoom(int bookId)
        {
            var book = await unitOfWork.Books.GetBook(bookId);

            if (book == null)
            {
                return(NotFound());
            }

            var lastDayRoom = book.DayRooms
                              .Where(dr => dr.DayRoomDate == (book.DayRooms
                                                              .Select(x => x.DayRoomDate).Max())).SingleOrDefault();

            var newDayRoom = new DayRoom()
            {
                BookId       = book.Id,
                RoomId       = book.RoomId,
                GuestsQty    = book.GuestNumber,
                DayRoomDate  = lastDayRoom.DayRoomDate.AddDays(1),
                DayRoomPrice = book.RoomRate,
                PaymentFlag  = false
            };

            book.DayRooms.Add(newDayRoom);
            book.TotalBill += book.RoomRate;
            await unitOfWork.CompleteAsync();

            return(Ok(mapper.Map <Book, BookResource>(book)));
        }
예제 #2
0
    protected IEnumerator ArriveDayroom(DayRoom place)
    {
        yield return(sec2);

        // Find a vacant seat.
        Seat seat = FindRandomSeat(place);

        // Wander and wait if no seats are available.
        while (!seat)
        {
            UpdateHeader(" looking for seat");

            Vector2 circle = Random.insideUnitCircle;
            navMeshAgent.SetDestination(new Vector3(circle.x * 2 + transform.position.x, 0f, circle.y * 2 + transform.position.z));
            yield return(sec3);

            seat = FindSeat(place);
        }
        yield return(StartCoroutine(Sit(seat)));

        UpdateState(Patient.PatientState.sittingIdle);
        isBusy = false;
    }
예제 #3
0
파일: Map.cs 프로젝트: BaronWhite/Incognito
    void CompileLists()
    {
        // Find all places and add them to correct list.
        foreach (var p in GameObject.FindGameObjectsWithTag("Place"))
        {
            switch (p.GetComponent <Place>().placeType)
            {
            case Place.PlaceType.hall:
                hall = p.GetComponent <Place>();
                break;

            case Place.PlaceType.cafeteria:
                cafeteria = p.GetComponent <Cafeteria>();
                break;

            case Place.PlaceType.kitchen:
                kitchen = p.GetComponent <Kitchen>();
                break;

            case Place.PlaceType.cell:
                cells.Add(p.GetComponent <Cell>());
                break;

            // Bathrooms.
            case Place.PlaceType.bathroomCentre:
                bathroomCentre = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                p.GetComponent <Place>().added = true;
                break;

            case Place.PlaceType.bathroomEast:
                bathroomEast = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.bathroomWest:
                bathroomWest = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.shower:
                showerRooms.Add(p.GetComponent <Place>());
                break;

            // Therapy Rooms
            case Place.PlaceType.therapy1:
                therapy1 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy2:
                therapy2 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy3:
                therapy3 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy4:
                therapy4 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy5:
                therapy5 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy6:
                therapy6 = p.GetComponent <Therapy>();
                break;

            // Other rooms.
            case Place.PlaceType.dayRoom:
                dayRoom = p.GetComponent <DayRoom>();
                break;

            // Staff
            case Place.PlaceType.pharmacy:
                pharmacy = p.GetComponent <Pharmacy>();
                break;

            case Place.PlaceType.records:
                records = p.GetComponent <Records>();
                break;

            case Place.PlaceType.office:
                office = p.GetComponent <Office>();
                break;

            case Place.PlaceType.staffRoom:
                staffroom = p.GetComponent <StaffRoom>();
                break;

            case Place.PlaceType.staffQuarters:
                staffquarters = p.GetComponent <StaffQuarters>();
                break;

            default:
                break;
            }
            p.GetComponent <Place>().added = true;
        }
    }