private void welcomeRoomtoOfficeNumber(int officeNumber) { var welcomeRoomToOffice = WelcomeRoom.Where(x => x.OfficeNumber == officeNumber); if (WelcomeRoom.Count > 0 && welcomeRoomToOffice != null) { Visitor visitor = WelcomeRoom.FirstOrDefault(); WelcomeRoom.Remove(visitor); offices[officeNumber].Enter(visitor); } }
public Visitor Exit() { Visitor visitor = WelcomeRoom.FirstOrDefault(); WelcomeRoom.Remove(visitor); if (waitingRoom.Count > 0) { Enter(waitingRoom.Dequeue()); } return(visitor); }
//private int[] generateOfficesCapacity(int nOffice) //{ // random = new Random(); // var getCapacities = new int[10]; // while (getCapacities.Min() == 0) // { // int maxCap = nOffice; // for (int i = 0; i < getCapacities.Length; i++) // { // getCapacities[i] = random.Next(maxCap); // maxCap -= getCapacities[i]; // } // } // return getCapacities; //} public void Enter(Visitor visitor) { Office officeToEnter = offices[visitor.OfficeNumber]; if (officeToEnter.IsThereSpace) { officeToEnter.Enter(visitor); //Console.WriteLine($"Entering office {officeToEnter}"); } else { WelcomeRoom.Add(visitor); } }
public void Enter(Visitor visitor) { if (visitor.Served) { Console.WriteLine($"I can't believe I finished, priority number {visitor.PriorityNumber}"); } else if (IsThereSpace == false) { waitingRoom.Enqueue(visitor); } else if (visitor.PriorityNumber == null) { visitor.PriorityNumber = GetPriorityNumber; GetPriorityNumber++; WelcomeRoom.Add(visitor); } }
public void Initialize() { const float cameraHeight = 1.5f; Vector3 cameraPosition = transform.position; cameraPosition.y = cameraHeight; // install camera for platform if (buildForCardboard) { Instantiate(cardboardCameraPrefab, cameraPosition, transform.rotation); isCardboard = true; Cardboard.SDK.EnableSettingsButton = false; player = Cardboard.SDK.gameObject; } else { player = Instantiate(oculusCameraPrefab, cameraPosition, transform.rotation) as GameObject; } // get camera's reset position so that it can be reset. if (player != null) { cameraResetPosition = player.transform.position; } // must create reticle after cameras since it trys to access them reticle = Instantiate(reticlePrefab).GetComponent <Crosshair3D>(); mainScene = Instantiate(mainScenePrefab).GetComponent <WelcomeRoom>(); mainScene.gameObject.SetActive(isMainScene); // add level manager to app levelManager = gameObject.AddComponent <LevelManager>(); levelManager.Initialize(cameraFadeScreenPrefab); }
public void Initialize() { const float cameraHeight = 1.5f; // install camera for platform if (buildForCardboard) { Instantiate(cardboardCameraPrefab, new Vector3(0, cameraHeight, 0f), Quaternion.identity); isCardboard = true; Cardboard.SDK.EnableSettingsButton = false; } else { Instantiate(oculusCameraPrefab, new Vector3(0, cameraHeight, 0f), Quaternion.identity); } // must create reticle after cameras since it trys to access them reticle = Instantiate(reticlePrefab).GetComponent<Crosshair3D>(); mainScene = Instantiate(mainScenePrefab).GetComponent<WelcomeRoom>(); mainScene.gameObject.SetActive(isMainScene); // add level manager to app levelManager = gameObject.AddComponent<LevelManager>(); levelManager.Initialize(cameraFadeScreenPrefab); ShowEnvironment(true); }
public void Initialize() { const float cameraHeight = 1.5f; Vector3 cameraPosition = transform.position; cameraPosition.y = cameraHeight; // install camera for platform if (buildForCardboard) { Instantiate(cardboardCameraPrefab, cameraPosition, transform.rotation); isCardboard = true; Cardboard.SDK.EnableSettingsButton = false; player = Cardboard.SDK.gameObject; } else { player = Instantiate(oculusCameraPrefab, cameraPosition, transform.rotation) as GameObject; } // get camera's reset position so that it can be reset. if (player != null) { cameraResetPosition = player.transform.position; } // must create reticle after cameras since it trys to access them reticle = Instantiate(reticlePrefab).GetComponent<Crosshair3D>(); mainScene = Instantiate(mainScenePrefab).GetComponent<WelcomeRoom>(); mainScene.gameObject.SetActive(isMainScene); // add level manager to app levelManager = gameObject.AddComponent<LevelManager>(); levelManager.Initialize(cameraFadeScreenPrefab); }