public List <BugDisplayModel> Get() { BugData data = new BugData(); var output = data.LoadBugs(); return(output); }
private void SpawnBugs() { for (int i = 0; i < bugs.Count; i++) { BugData data = bugs[i]; StartCoroutine(SpawnBug(bugs[i])); } }
private void ApplyRandomColor() { for (int i = 0; i < bugs.Count; i++) { BugData data = bugs[i]; data.bugColor = BugColoring.Instance.GetRandomColor(); } }
public ActionResult DeleteBug(int BugID) { BugData dataService = new BugData(); dataService.DeleteSpecificBug(BugID); return(RedirectToAction("CurrentBugs", "Bug")); }
public ActionResult CurrentBugs() { BugData dataService = new BugData(); List <Bug> bugs = dataService.GetAllBugs(); ViewBag.Data = dataService.GetAllAgentUsernames(); ViewBag.Status = dataService.GetAllBugStatus(); ViewBag.Priority = dataService.GetAllBugPriority(); return(View("CurrentBugs", bugs)); }
private void SetInfos(BugDNA dna, BugData data) { mInfos.Health.text = Math.Round(data.Health, 2).ToString(); mInfos.HealthLossPerS.text = Math.Round(data.HealthLoss, 2).ToString(); mInfos.ChildCap.text = Math.Round(data.ChildHealth, 2).ToString(); mInfos.HealthPerFood.text = Math.Round(data.FoodHealth, 2).ToString(); mInfos.MutatioRate.text = Math.Round(dna[BugValue.MutationRate], 2).ToString(); mInfos.Parts.text = data.Parts.ToString(); mInfos.SightDistance.text = Math.Round(dna[BugValue.SightDistance], 2).ToString(); mInfos.Speed.text = Math.Round(dna[BugValue.Speed], 2).ToString(); mInfos.TurnMomentum.text = Math.Round(dna[BugValue.TurnMomentum], 2).ToString(); }
public void Init(BugData bugData) { this.bugData = bugData; Color modifiedColor; Sprite colorSprite = BugColoring.Instance.GetSpriteByType(bugData.bugColor, out modifiedColor); if (colorSprite != null) { spriteRender.sprite = colorSprite; color = modifiedColor; } health = bugData.health; }
IEnumerator SpawnBug(BugData data) { yield return(new WaitForSeconds(data.spawnTime)); if (!data.flying) { Transform spawnLocation = data.fromLeft ? leftGroundSpawn : rightGroundSpawn; GameObject bug = Instantiate(groundBugPrefab, spawnLocation.position, Quaternion.identity); Bug bugCtrl = bug.GetComponent <Bug>(); bugCtrl.Init(data); BossBug bossBugCtrl = bug.GetComponent <BossBug>(); bossBugCtrl.Init(data.health); } }
public ActionResult ViewBug(int BugId) { BugData dataService = new BugData(); Bug bug = dataService.GetSpecificBug(BugId); UserAdminData userDataService = new UserAdminData(); List <UserAdminModel> Agents = userDataService.GetAllUsers(); List <BugComments> comments = dataService.GetSpecificBugComments(BugId); bug.Comments = comments; ViewBag.Data = dataService.GetAllBugStatus(); ViewBag.Agents = Agents; ViewBag.Priority = dataService.GetAllBugPriority(); return(View("ViewBug", bug)); }
public ActionResult BugCreateForm(Models.Bug bu) { ViewBag.Summary = Request.Form["Summary"]; ViewBag.Description = Request.Form["Description"]; ViewBag.AssignedID = Request.Form["userAssigned"]; ViewBag.PriorityID = Request.Form["PrioritySelected"]; ViewBag.UserName = User.Identity.Name; Int32.TryParse(ViewBag.PriorityID, out int PriorityID); BugData dataService = new BugData(); dataService.CreateNewBug(ViewBag.AssignedID, ViewBag.Summary, ViewBag.Description, ViewBag.UserName, PriorityID); return(RedirectToAction("CurrentBugs", "Bug")); }
public ActionResult ViewBug(Models.Bug bu) { ViewBag.Description = Request.Form["Description"]; ViewBag.StatusID = Request.Form["Status"]; ViewBag.AssignedID = (Request.Form["Assigned"] == "" ? null : Request.Form["Assigned"]); ViewBag.Summary = Request.Form["Summary"]; ViewBag.PriorityID = Request.Form["Priority"]; ViewBag.UpdateUserName = User.Identity.Name; Int32.TryParse(ViewBag.StatusID, out int StatusID); Int32.TryParse(ViewBag.PriorityID, out int PriorityID); BugData dataService = new BugData(); dataService.SaveSpecificBug(bu.BugID, ViewBag.Summary, ViewBag.Description, StatusID, ViewBag.AssignedID, ViewBag.UpdateUserName, PriorityID); return(ViewBug(bu.BugID)); }
public ActionResult Comment(Models.Bug bu) { ViewBag.Comment = Request.Form["CommentText"]; ViewBag.UserName = User.Identity.Name; BugData dataService = new BugData(); dataService.CreateNewBugComment(ViewBag.UserName, ViewBag.Comment, bu.BugID); string subject = "#INC-" + bu.BugID + " Comment Added"; if (bu.Assigned != "") { string Message = CreateHTMLBody(bu.BugID, ViewBag.UserName + " added a note: " + ViewBag.Comment); SendEmail(bu.Assigned, subject, Message); } return(ViewBug(bu.BugID)); }
IEnumerator SpawnBug(BugData data) { yield return(new WaitForSeconds(data.spawnTime)); if (!data.flying) { Transform spawnLocation = data.fromLeft ? leftGroundSpawn : rightGroundSpawn; GameObject bug = Instantiate(groundBugPrefab, spawnLocation.position, Quaternion.identity); Bug bugCtrl = bug.GetComponent <Bug>(); bugCtrl.Init(data); LinearMove movementCtrl = bug.GetComponent <LinearMove>(); movementCtrl.Init(data.fromLeft, data.speed); } else { Transform spawnLocation = data.fromLeft ? leftAirSpawn : rightAirSpawn; GameObject bug = Instantiate(airBugPrefab, spawnLocation.position, Quaternion.identity); Bug bugCtrl = bug.GetComponent <Bug>(); bugCtrl.Init(data); SineMove movementCtrl = bug.GetComponent <SineMove>(); movementCtrl.Init(data.fromLeft, data.speed, spawnLocation.position.y, -1, -1); } }
public void Put(List <string> idList) { BugData data = new BugData(); data.UpdateAssignedUser(idList); }
public void Post(BugModel bug) { BugData data = new BugData(); data.SaveBug(bug); }
IEnumerator SpawnBug(int subIndex, BugData data) { yield return(new WaitForSeconds(data.spawnTime)); Transform spawnLocation = null; if (bugNum == 1) { spawnLocation = SpawnPosition1; } else if (bugNum == 2) { if (subIndex == 1) { spawnLocation = SpawnPosition21; } else if (subIndex == 2) { spawnLocation = SpawnPosition22; } } else if (bugNum == 3) { if (subIndex == 1) { spawnLocation = SpawnPosition31; } else if (subIndex == 2) { spawnLocation = SpawnPosition32; } else if (subIndex == 3) { spawnLocation = SpawnPosition33; } } else if (bugNum == 4) { if (subIndex == 1) { spawnLocation = SpawnPosition41; } else if (subIndex == 2) { spawnLocation = SpawnPosition42; } else if (subIndex == 3) { spawnLocation = SpawnPosition43; } else if (subIndex == 4) { spawnLocation = SpawnPosition44; } } GameObject bug = Instantiate(groundBugPrefab, spawnLocation.position, Quaternion.identity); Bug bugCtrl = bug.GetComponent <Bug>(); bugCtrl.Init(data); }