title: C# Clothing System for Character
body: <p>I'm attempting to create a flexible system for clothing my character in my game. Right now I've got a base class from which all child clothing classes will extend, and additional interfaces to bring which body parts they actually clothe into the equation. Here's my code:</p>
  
  <pre><code>public class Clothing
  {
      public EClothingBind[] Types;
      public int ID;
      public int Priority;
      public bool HidesUnderlying;
      public AnimatedSpriteMap Graphic;
      public Color Blend = Color.White;
  
      public virtual void Update(GameTime gameTime) 
      {
          Graphic.Update(gameTime);
      }
  
      public virtual void Draw(Vector2 position)
      {
          Graphic.Tint = Blend;
          Graphic.Draw(position);
      }
  }
  
  public interface IClothingHead { ... }
  public interface IClothingChest { ... }
  public interface IClothingLegs { ... }
  public interface IClothingFeet { ... }
  </code></pre>
  
  <p>Right now this doesn't work well, as the design doesn't really restrict what can implement my IClothing interfaces. Is there a way to restrict interface implementation to certain types? I don't want to turn my interfaces into classes because I'd like an article of clothing, say a robe, to cover the whole body (implementing all four). I'm a bit lost on what's the best way to go about doing this, and all input is much appreciated. Thanks.</p>