private void CheckFirstRun() { var bodyStats = App.DatabaseBodyStats.SelectLastBodyStats().Result; if (bodyStats.Count == 0) { BodyStats bodyStat = new BodyStats(); bodyStat.Height = 0; bodyStat.Weight = 0; bodyStat.WaistCircumference = 0; bodyStat.ThighCircumference = 0; bodyStat.BicepsCircumference = 0; App.DatabaseBodyStats.SaveItemAsync(bodyStat); } var Records = App.DatabasePersonalRecord.SelectHighestRecord().Result; if (Records.Count == 0) { PersonalRecord personalRecord = new PersonalRecord(); personalRecord.Benchpress = 0; personalRecord.Deathlift = 0; personalRecord.Squat = 0; App.DatabasePersonalRecord.SaveItemAsync(personalRecord); } }
public ActivityNode(string flavorText, BodyStats mainStress, BodyStats sideStress, string flavorImage) { this.FlavorText = flavorText; this.MainStress = mainStress; this.SideStress = sideStress; this.FlavorImage = flavorImage; }
public ActionResult AddBodyStatus(int id) { //ViewBag.data = id; BodyStats bodyStats = new BodyStats(); bodyStats.UserId = id; return(View(bodyStats)); }
public void ChangeStats(BodyStats mainStress, BodyStats sideStress, bool addStress) { popupFrame.SetActive(true); CalculateStress(mainStress); if (addStress) { CalculateStress(sideStress); } }
public ActionResult EditBodyStats(int UserId, int id) { BodyStatsBusinessLayer bodyStatsBusinessLayer = new BodyStatsBusinessLayer(); BodyStats bodyStats = bodyStatsBusinessLayer.GetBodyStats(UserId).Single(b => b.BodyStatId == id); return(View(bodyStats)); }
public static StatsList CreateStatsListWithDefaultValues() { AttackStats attackStats = new AttackStats(0, 0, 0, 0, 0); DefenceStats defenceStats = new DefenceStats(0, 0, 0, 0, 0); BodyStats body = new BodyStats(0, 0); CritStats crit = new CritStats(0, 0); StatsList stats = new StatsList(attackStats, defenceStats, body, crit); return(stats); }
public void UpdateBodyInfo() { if (m_Spirit.transform.parent != null) { m_Body = m_Spirit.transform.parent.gameObject; m_BodyStats = m_Body.GetComponent <BodyStats>(); } else { m_Body = null; } }
public ActionResult AddBodyStatus(BodyStats bodyStats) { if (ModelState.IsValid) { BodyStatsBusinessLayer bodyStatsBusinessLayer = new BodyStatsBusinessLayer(); bodyStatsBusinessLayer.AddBodyStats(bodyStats); return(RedirectToAction("BodyStats", new { id = bodyStats.UserId })); } return(View()); }
private void SaveBodyStatData(BodyStats bodyStat) { if (App.IsNumber(WeightE.Text)) { bodyStat.Weight = App.setNumber(WeightE.Text); } else { ErrorL.Text = "Zadej pouze číslo"; } if (App.IsNumber(HeightE.Text)) { bodyStat.Height = App.setNumber(HeightE.Text); } else { ErrorL.Text = "Zadej pouze číslo"; } if (App.IsNumber(WaistE.Text)) { bodyStat.WaistCircumference = App.setNumber(WaistE.Text); } else { ErrorL.Text = "Zadej pouze číslo"; } if (App.IsNumber(ThighE.Text)) { bodyStat.ThighCircumference = App.setNumber(ThighE.Text); } else { ErrorL.Text = "Zadej pouze číslo"; } if (App.IsNumber(BicepsE.Text)) { bodyStat.BicepsCircumference = App.setNumber(BicepsE.Text); } else { ErrorL.Text = "Zadej pouze číslo"; } bodyStat.Date = DateE.Date.ToString(); bodyStat.Date = bodyStat.Date.Remove(bodyStat.Date.Length - 8); App.DatabaseBodyStats.SaveItemAsync(bodyStat); }
private void CalculateStress(BodyStats stresser) { switch (stresser) { case (BodyStats.HEART): hrt--; break; case (BodyStats.MIND): mind--; break; case (BodyStats.STRENGTH): str--; break; default: endu--; break; } }
private void SaveBodyStats() { if (string.IsNullOrEmpty(HeightE.Text) && string.IsNullOrEmpty(WeightE.Text) && string.IsNullOrEmpty(WaistE.Text) && string.IsNullOrEmpty(ThighE.Text) && string.IsNullOrEmpty(BicepsE.Text)) { ErrorL.TextColor = Color.FromHex("#FF4081"); ErrorL.Text = "Nevložil si data"; } else { ErrorL.Text = "STATISTIKY TĚLA"; var bodyStats = App.DatabaseBodyStats.SelectLastBodyStats().Result; BodyStats bodyStat = new BodyStats(); bodyStat.Weight = bodyStats[0].Weight; bodyStat.Height = bodyStats[0].Height; bodyStat.WaistCircumference = bodyStats[0].WaistCircumference; bodyStat.ThighCircumference = bodyStats[0].ThighCircumference; bodyStat.BicepsCircumference = bodyStats[0].BicepsCircumference; SaveBodyStatData(bodyStat); ErrorL.Text = "Úspěšně uloženo"; Application.Current.MainPage = new MenuPage(); } }
private static void StartDay() { var player = GameInstance.Instance.CurrentPlayer; Console.WriteLine("\nNew day. What will it bring?"); ConsoleHelper.LogUserMessage("Current health is {0}hp", BodyStats.GetTotalHealth(GameInstance.Instance.CurrentPlayer)); ConsoleHelper.FilterInput("Press enter to make a move and see what this day brought you", new ConsoleKey[] { ConsoleKey.Enter }); var dayEvent = EventWeight.Pick(new List <EventWeight> { new EventWeight { Event = EventType.None, PickWeight = 20 }, new EventWeight { Event = EventType.VillageAproach, PickWeight = 15 }, new EventWeight { Event = EventType.MonsterEncounter, PickWeight = 65 } }); switch (dayEvent) { case EventType.None: HandleNoneEncounter(); break; case EventType.VillageAproach: HandleVillageEncounter(); break; case EventType.MonsterEncounter: HandleMonsterEncounter(); break; default: break; } }
void DealStressToUser(BodyStats mainStress, BodyStats sideStress, bool causeStress) { dayManager.GetComponent <DayGameManager>().ChangeStats(mainStress, sideStress, causeStress); }
public void PartialRegenerate(int buff = 0) { PartialRegenerate_Action(buff); Console.WriteLine("You have healed up a little bit."); ConsoleHelper.LogUserMessage("Current health is {0}hp", BodyStats.GetTotalHealth(this)); }