Example #1
0
        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;
            }
        }
Example #2
0
 private void PrintAttribute(int x, int y, Attribute attribute)
 {
     Canvas.PrintString(x, y, String.Format("{0}: {1}/{2}", attribute.Abbreviation, attribute.Value, attribute.MaximumValue));
 }
Example #3
0
        private BodyComponent(int health, int maxHealth, List <Appendage> bodyParts)
        {
            Health = new Attribute("Health", "HP ", maxHealth, health);

            this._bodyParts = bodyParts;
        }