// Start is called before the first frame update void Start() { roomList = new RoomSlot[roomCount]; loadedRooms = new GameObject[roomCount]; List <Vector3> roomLocations = new List <Vector3>(); roomLocations.Add(new Vector3(-room_space, 0, 0)); roomLocations.Add(new Vector3(0, 0, 0)); roomLocations.Add(new Vector3(room_space, 0, 0)); roomLocations.Add(new Vector3(-room_space, room_space, 0)); roomLocations.Add(new Vector3(0, room_space, 0)); roomLocations.Add(new Vector3(room_space, room_space, 0)); roomLocations.Add(new Vector3(-room_space, room_space * 2, 0)); roomLocations.Add(new Vector3(0, room_space * 2, 0)); roomLocations.Add(new Vector3(room_space, room_space * 2, 0)); for (int i = 0; i < roomCount; i++) { roomList[i] = new RoomSlot(roomLocations[i]); } }
public async Task <ActionResult> AssignRoomSlot(int slotId, int roomId, RoomSlot roomSlot) { if (ModelState.IsValid) { var oldRoomSlot = await dbContext.RoomSlots.SingleOrDefaultAsync(rs => rs.RoomId == roomId && rs.SlotId == slotId); if (oldRoomSlot != null) { oldRoomSlot.AssignedSessionId = roomSlot.AssignedSessionId; dbContext.Entry(oldRoomSlot).State = EntityState.Modified; } else { dbContext.RoomSlots.Add(roomSlot); } await dbContext.SaveChangesAsync(); } return(RedirectToAction("Index")); }
public void SelectRoom(RoomSlot roomSlot){ selectedSlot = roomSlot; }