mixin costumeSetting(type, options)
  - options = options || {}
  - var costume = (options.prefix || '') + 'profile.items.gear.costume.' + type + (options.suffix || '')
  - var equipped = (options.prefix || '') + 'profile.items.gear.equipped.' + type + (options.suffix || '')
  span(ng-class="profile.preferences.costume ? #{costume} : #{equipped}")

mixin generatedAvatar(options)
  - options = options || {}
  span(class='chair_{{profile.preferences.chair}}')
  +costumeSetting('back')
  if options.sleep
    span(ng-class="'skin_' + profile.preferences.skin + '_sleep'")
  else
    span(ng-class="profile.preferences.sleep ? 'skin_' + profile.preferences.skin + '_sleep' : 'skin_' + profile.preferences.skin")
  span(class='{{profile.preferences.size}}_shirt_{{profile.preferences.shirt}}')
  +costumeSetting('armor', {prefix: "profile.preferences.size + '_' + "})
  +costumeSetting('back', {suffix: " + '_collar'"})
  +costumeSetting('body')
  span.head_0
  - var hairTypes = ['base', 'bangs', 'mustache', 'beard']
  each type in hairTypes
    span(class='hair_#{type}_{{profile.preferences.hair.#{type}}}_{{profile.preferences.hair.color}}')
  +costumeSetting('eyewear')
  +costumeSetting('head')
  +costumeSetting('headAccessory')
  span(class='hair_flower_{{profile.preferences.hair.flower}}')
  +costumeSetting('shield')
  +costumeSetting('weapon')
