public void PermuteOrder() //Inutilisé { Wrestler perm = Beginner; Beginner = Second; Second = Beginner; }
public ActionResult Wrestler() { var model = new Wrestler { Id = 1, Name = "John Cena", WeightClass = WeightClass.Heavy, MuscleDensity = 1.0m, Tattoos = new List <Tattoo> { new Tattoo { Location = "Face/Neck", Color = "Black", Size = 3, Toughness = 10, IsVisible = true }, new Tattoo { Location = "Lowerback", Color = "Grey", Size = 1, Toughness = -1, IsVisible = false } } }; return(View(model)); }
public void Save(string gameID) { foreach (Wrestler wrestler in wrestlers) { Wrestler.Save(wrestler, gameID); } }
void GenerateNewWrestler(int phase) { Wrestler wrestler = CreateEmptyWrestler(); wrestlerGenerator.GenerateWrestler(wrestler, phase); wrestlers.Add(wrestler); }
public override object Read(ES2Reader reader) { Wrestler param = GetOrCreate <Wrestler>(); Read(reader, param); return(param); }
public void DeleteSeveralWrestlers() { Wrestler.Delete(new List <string>() { "9252", "9254", "9253", "9251" }); }
public static bool Save(Wrestler wrestler, string gameID) { string filename = WrestlerManager.GetFilename(gameID) + "?tag=" + wrestler.id; ES2.Save(wrestler, filename); return(true); }
void OnHireWrestler() { Wrestler hiredWrestler = wrestlers.Find(x => x.wrestlerName == wrestlerDialog.GetSelectedOption().name); gameManager.GetPlayerCompany().AddWrestlerToRoster(hiredWrestler); gameManager.GetPlayerCompany().money -= hiredWrestler.hiringCost; gameManager.OnCompanyUpdated(); bool hasTwoPlusWrestlers = (gameManager.GetPlayerCompany().GetRoster().Count > 1); // If the player doesn't have enough wrestlers, we won't let the player leave the hiring screen. bool hasMoreWrestlersToHire = (GetWrestlersForHire().Count > 0); addAnotherDialog = gameManager.GetGUIManager().InstantiateInfoDialog(); if (hasMoreWrestlersToHire) { if (gameManager.GetPlayerCompany().CanAddWrestlers()) { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\n" + (hasTwoPlusWrestlers ? "Would you like to hire another wrestler?" : "Now, choose another wrestler!"), new UnityAction(HireWrestler), hasTwoPlusWrestlers, new UnityAction(DoneHiring), "Yes", "No"); } else { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\nYour roster is now full.", new UnityAction(DoneHiring)); } } else { addAnotherDialog.Initialize("Wrestler hired!", "You hired " + hiredWrestler.wrestlerName + "!\nThere aren't any more wrestlers available for hire.", new UnityAction(DoneHiring)); } }
public Wrestler CreateEmptyWrestler() { Wrestler wrestler = Instantiate(wrestlerPrefab) as Wrestler; wrestler.transform.SetParent(transform, false); return(wrestler); }
public void AddUsedMatchType(WrestlingMatchType type) { if (!HasUsedMatchType(type)) { usedMatchTypes.Add(type.typeName); Wrestler.Save(this, SavedGameManager.Instance.CurrentGameID); } }
public void AddUsedMatchFinish(WrestlingMatchFinish finish) { if (!HasUsedMatchFinish(finish)) { usedMatchFinishes.Add(finish.finishName); Wrestler.Save(this, SavedGameManager.Instance.CurrentGameID); } }
public int?AddWrestler(Wrestler w) { w.CreationDate = DateTime.UtcNow; var id = _repositoryWrestler.AddWithIdentity(w); _unitOfWork.Commit(); return(id); }
public ActionResult Wrestler(Wrestler model) { if (ModelState.IsValid) { return(RedirectToAction("Index")); } return(View(model)); }
public void CreateWrestlerTest(WrestlerModel model) { var id = Wrestler.Create(model); // compare models var modelCurrent = Wrestler.Read(id); model.CompareModels(modelCurrent); }
public void CreateWrestlerUploadAndDeleteAttachmentTest(WrestlerModel model) { var id = Wrestler.Create(model); var attachModel = Wrestler.UploadAttachment(id, PathToFiles + model.attaches[0].filename); var result = Wrestler.DeleteAttachment(attachModel.id).result; Assert.AreEqual(true, Boolean.Parse(result)); }
public override bool IsValid(object value) { Wrestler model = value as Wrestler; if (model != null) { return(!(model.WeightClass == WeightClass.Heavy && model.MuscleDensity < 0.5m)); } return(false); }
private void btn_cancel_Click(object sender, EventArgs e) { DialogResult exitResult = MessageBox.Show("Are you sure you would like to exit?", "Exit", MessageBoxButtons.YesNo); if (exitResult == DialogResult.Yes) { NewWrestler = null; this.Close(); } }
public static bool Remove(Wrestler wrestler, Guid promotionId) { var wrestlers = GetList(promotionId); wrestlers.Remove(wrestlers.Where(x => x.ID == wrestler.ID).SingleOrDefault()); UpdateDataList(wrestlers, promotionId); return(true); }
public void CreateWrestlerWithTwoTextAttachmentsTest(WrestlerModel model) { var id = Wrestler.Create(model); for (int i = 0; i < model.attaches.Count; i++) { var attachModel = Wrestler.UploadAttachment(id, PathToFiles + model.attaches[i].filename); //compare attachment model } }
public void CreateWrestlerWithPhotoAttachmentAPITest(WrestlerModel model) { var id = Wrestler.Create(model); var attachModel = Wrestler.UploadPhoto(id, PathToFiles + model.attaches[0].filename); //compare models var modelCurrent = Wrestler.Read(id); model.CompareModels(modelCurrent); }
public static bool Update(Wrestler wrestler, Guid promotionId) { if (Remove(wrestler.ID, promotionId)) { return(Add(wrestler, promotionId)); } else { return(false); } }
public void AddWrestlerToRoster(Wrestler wrestler) { if (CanAddWrestlers()) { roster.Add(wrestler); Save(this, SavedGameManager.Instance.CurrentGameID); } else { throw new UnityException("Unable to add wrestler to company '" + companyName + ": The roster is full"); } }
public CreateWrestlerForm(Wrestler wrestler) { InitializeComponent(); txt_wrestlerFirstName.Text = wrestler.FirstName; txt_wrestlerLastName.Text = wrestler.LastName; txt_wrestlerSchool.Text = wrestler.School; dtp_birthDate.Value = wrestler.BirthDay; NewWrestler = wrestler; IsEditing = true; }
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { var result = new Wrestler(); result.Name = controllerContext.RequestContext.HttpContext.Request.Form["Name"]; int day = int.Parse(controllerContext.RequestContext.HttpContext.Request.Form["day"]); int month = int.Parse(controllerContext.RequestContext.HttpContext.Request.Form["month"]); int year = int.Parse(controllerContext.RequestContext.HttpContext.Request.Form["year"]); result.Birthday = new DateTime(year, month, day); return(result); }
public CurrentTournamentForm(Tournament tournament, List <Wrestler> allWrestlers) { InitializeComponent(); CurrentTournament = new Tournament(tournament); foreach (Wrestler wrestler in allWrestlers) { Wrestler newWrestler = new Wrestler(wrestler); AllWrestlers.Add(newWrestler); } }
/// <summary> /// Wrestlers loaded by ES2 are game objects separate from wrestlers loaded by the wrestler manager, leading to duplicates. /// Call this function to replace the wrestler clones with the canonical ones in the wrestler manager. /// </summary> void SyncRoster() { for (int i = 0; i < roster.Count; ++i) { Wrestler wrestler = roster[i]; Wrestler canonicalWrestler = WrestlerManager.Instance.GetWrestler(wrestler.wrestlerName); if (canonicalWrestler != null) { Destroy(wrestler.gameObject); roster[i] = canonicalWrestler; } } }
public static bool Add(Wrestler wrestler, Guid promotionId) { if (wrestler.ID == null || wrestler.ID == Guid.Empty) { wrestler.ID = Guid.NewGuid(); } var wrestlers = GetList(promotionId); wrestlers.Add(wrestler); UpdateDataList(wrestlers, promotionId); return(true); }
void OnWrestlersPicked() { Wrestler wrestler1 = wrestlers.Find(x => x.wrestlerName == wrestlersDialog.GetWrestler1().name); Wrestler wrestler2 = wrestlers.Find(x => x.wrestlerName == wrestlersDialog.GetWrestler2().name); match.teams.Add(new WrestlingTeam(wrestler1)); match.teams.Add(new WrestlingTeam(wrestler2)); usedWrestlers.Add(wrestler1); usedWrestlers.Add(wrestler2); matchTypeDialog = gameManager.GetGUIManager().InstantiateSelectOptionDialog(true); matchTypeDialog.Initialize("Match type", GetAvailableMatchTypes(), new UnityAction(OnMatchTypePicked)); }
public void Start() { owner = GetComponent<Wrestler>(); timer = 0; state = State.Tell; tellTime = 0.200f; activeTime = 0.200f; cooldownTime = 0.200f; tellVelocity = 0; activeVelocity = 0; cooldownVelocity = 0; }
public static void ShowAddWrestler() { var wrestler = new Wrestler(); DisplayHelper.ClearScreen(); Console.WriteLine("ADD WRESTLER"); wrestler.Name = InputHelper.GetString("Name: "); wrestler.Nickname = InputHelper.GetString("Nickname: "); wrestler.Gender = InputHelper.GetGender(); Console.WriteLine(""); Console.WriteLine("ATTRIBUTES"); wrestler.Attributes = new Attributes(); wrestler.Attributes.Strength = InputHelper.GetIntRating("Strength: "); wrestler.Attributes.Agility = InputHelper.GetIntRating("Agility: "); wrestler.Attributes.Intelligence = InputHelper.GetIntRating("Intelligence: "); wrestler.Attributes.Toughness = InputHelper.GetIntRating("Toughness: "); if (WrestlerManager.Add(wrestler, _promotion.ID)) { ShowViewWrestlers(); } else { Console.WriteLine("Adding wrestler failed. What do you want to do?"); Console.WriteLine("1. Try again"); Console.WriteLine("2. Go back to wrestlers list"); var choice = InputHelper.GetIntCharacter(1, 2); switch (choice) { case 1: ShowViewWrestlers(); break; case 2: ShowAddWrestler(); break; default: ShowViewWrestlers(); break; } } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { uint Base = 0x0A14; Base = (uint)(Base + comboBox1.SelectedIndex * 0x0104); Wrestler = new Wrestler(fname, Base); strengthValue.Value = Wrestler.Strength; submissionValue.Value = Wrestler.Submission; speedValue.Value = Wrestler.Speed; techValue.Value = Wrestler.Technique; durValue.Value = Wrestler.Durability; charValue.Value = Wrestler.Charisma; stamValue.Value = Wrestler.Stamina; hardValue.Value = Wrestler.Hardcore; }
public void Start() { owner = GetComponent<Wrestler>(); owner.inputDevice = this; }