public void writeHealth(Patient pat) { Vital v = pat.MajorVitalMap[VitalType.Health]; Console.SetCursorPosition(_sideCol, _healthRow); int strLength = 0; string str = ""; string blanks = ""; writeStrInColor(Game.Util.getVitalName(v.type), v.textColor); Console.Write(" "); if (v.CurrentValue > v.normalMax || v.CurrentValue < v.normalMin) { writeStrInColor(v.CurrentValue.ToString(), ConsoleColor.Red); } else { writeStrInColor(v.CurrentValue.ToString(), ConsoleColor.Green); } str += v.unit; if (pat.deltaHealth == 0) { str = " won't change "; Console.Write(str); } else if (pat.deltaHealth > 0) { str = " will increase by "; Console.Write(str); writeStrInColor(pat.deltaHealth.ToString(), ConsoleColor.Green); } else if (pat.deltaHealth < 0) { str = " will decrease by "; Console.Write(str); writeStrInColor(pat.deltaHealth.ToString(), ConsoleColor.Red); } strLength += Game.Util.getVitalName(v.type).Length + v.CurrentValue.ToString().Length + pat.deltaHealth.ToString().Length + str.Length; blanks += new string (' ', (this._width - 4 - strLength)); Console.WriteLine(blanks); //writeVital (pat.HealthPoint, this._sideCol, this._healthRow, false); }
private void writeVital(Vital v, int col, int row, bool mainVit) { Console.SetCursorPosition(col, row); int strLength = 0; string str = ""; string blanks = ""; writeStrInColor(Game.Util.getVitalName(v.type), v.textColor); Console.Write(" "); if (v.CurrentValue > v.normalMax || v.CurrentValue < v.normalMin) { writeStrInColor(v.CurrentValue.ToString(), ConsoleColor.Red); } else { writeStrInColor(v.CurrentValue.ToString(), ConsoleColor.Green); } string minMax = v.unit + " (" + v.normalMin + "," + v.normalMax + ") "; Console.Write(minMax); Console.Write(v.turnChangeStatus); /* * if (mainVit) { * if (v.delta1 != 0) { * str += " changed by " + v.delta1; * } * if (v.CurrentValue > v.normalMax) { * str += " WARNING > Normal Limits of " + v.normalMax; * } * if (v.CurrentValue < v.normalMin) { * str += " WARNING < Normal Limit of " + v.normalMin; * } * } */ strLength += 1 + Game.Util.getVitalName(v.type).Length + v.CurrentValue.ToString().Length + str.Length + minMax.Length + v.turnChangeStatus.Length; blanks += new string (' ', (this._width - 3 - strLength)); Console.WriteLine(str + blanks); }
private void writeVitalUpdate(Vital v, int col, int row) { Console.SetCursorPosition(col, row); writeStrInColor(Game.Util.getVitalName(v.type), v.textColor); string str = ": has changed by " + v.delta1; if (v.CurrentValue > v.normalMax) { str += " WARNING > Noramal Limits of " + v.normalMax; } if (v.CurrentValue < v.normalMin) { str += " WARNING < Noramal Limit of " + v.normalMin; } string blanks = new string (' ', (this._width - 3 - Game.Util.getVitalName(v.type).Length - str.Length)); str += blanks; Console.WriteLine(str); }
public void setDeltaHealth() { this.deltaHealth = 0; foreach (VitalType vt in this.MinorVitalMap.Keys) { Vital v = this.MinorVitalMap[vt]; Vital health = this.MajorVitalMap[VitalType.Health]; if (v.CurrentValue > v.normalMax || v.CurrentValue < v.normalMin) { this.deltaHealth -= 1; } else { this.deltaHealth += 1; } if (health.CurrentValue + deltaHealth > health.max) { deltaHealth = health.max - health.CurrentValue; } } }