public BodyComponent(int health, List <Appendage> bodyParts) { Contract.Requires <ArgumentException>(bodyParts.Count > 0); Health = new Attribute("Health", "HP ", health, health); this._bodyParts = bodyParts; foreach (var part in bodyParts) { part.Owner = this; } }
private void PrintAttribute(int x, int y, Attribute attribute) { Canvas.PrintString(x, y, String.Format("{0}: {1}/{2}", attribute.Abbreviation, attribute.Value, attribute.MaximumValue)); }
private BodyComponent(int health, int maxHealth, List <Appendage> bodyParts) { Health = new Attribute("Health", "HP ", maxHealth, health); this._bodyParts = bodyParts; }