public void AllowConfiguringWhatKindOfNameToGet() { // Set up test with a name var nameGateway = new TestNamesGateway(); var namer = new NameCharacter(nameGateway); nameGateway.FirstName = "John"; nameGateway.LastName = "Smith"; Assert.AreEqual("(Male-Orc)John OrcSmith", namer.CreateFullName(Gender.Male, "Orc")); }
private void OnEnable() { confirmedCharIndex = 0; selectedCharIndex = new NameCharacter(); inputTextUI.text = new String(inputText); FinalNameTextUI.text = new String(finalNameText); ScoreTextUI.text = gameManager.pointsUI.text; UpdateText(0); }
public IActionResult Index() { var namer = new NameCharacter(); var races = GatewayProvider.Get <Race>().All(); var number = 5; var results = new List <NamesViewModel>(); //Foreach race and gender make a collection of names foreach (var r in races) { foreach (var g in EnumHelpers.GetValues <Gender>()) { var genderRaceNames = new NamesViewModel(r.Name, g); for (int i = 0; i < number; i++) { var name = namer.CreateFullName(g, r.Name); genderRaceNames.Names.Add(name); } results.Add(genderRaceNames); } } ViewData["names"] = results; return(View()); }
// Update is called once per frame private void Update() { if (!gameManager.IsBeingUsed()) { return; } else if (!NextCharTriggered && ((Input.GetButtonDown("Vertical") && Input.GetAxis("Vertical") > 0) || Input.GetAxis("Vertical") > 0)) { if ((int)selectedCharIndex >= 26) { selectedCharIndex = NameCharacter.A; } else { selectedCharIndex++; } UpdateText(confirmedCharIndex); NextCharTriggered = true; } else if (!NextCharTriggered && ((Input.GetButtonDown("Vertical") && Input.GetAxis("Vertical") < 0) || Input.GetAxis("Vertical") < 0)) { if (selectedCharIndex <= 0) { selectedCharIndex = NameCharacter._; } else { selectedCharIndex--; } UpdateText(confirmedCharIndex); NextCharTriggered = true; } else if (NextCharTriggered && Input.GetAxis("Vertical") == 0) { NextCharTriggered = false; } else if (Input.GetButtonDown("Back") && confirmedCharIndex > 0) { finalNameText[confirmedCharIndex] = '-'; inputText[confirmedCharIndex] = ' '; confirmedCharIndex--; finalNameText[confirmedCharIndex] = ' '; inputText[confirmedCharIndex] = selectedCharIndex.ToString()[0]; UpdateText(0, false, true); } else if (Input.GetButtonDown("Fire") || Input.GetButtonDown("Start")) { if (selectedCharIndex == NameCharacter._) { inputText[confirmedCharIndex] = selectedCharIndex.ToString()[0]; finalNameText[confirmedCharIndex] = ' '; UpdateText(0, false, true); } else { UpdateText(confirmedCharIndex, true); } confirmedCharIndex++; //if we've hit the end disable this gameobject and enable leaderboard if (confirmedCharIndex == 8) { //Reset input text for (int i = 0; i < finalNameText.Length; i++) { finalNameText[i] = '-'; inputText[i] = ' '; } //CHECK FOR PROFANITY HERE if (gameManager.ProfanityCheck(FinalNameTextUI.text)) { confirmedCharIndex = 0; inputText[confirmedCharIndex] = selectedCharIndex.ToString()[0]; UpdateText(0, false, true); } else { gameManager.PassFinalName(FinalNameTextUI.text); gameManager.ApplyPointsToLeaderboard(); gameManager.ShowLeaderBoard(); gameObject.SetActive(false); } } else { UpdateText(confirmedCharIndex); } } }