title: Workaround for Swift Enum with raw type + case arguments?
body: <p>I'd like to create SKSpriteNodes with a <code>WallType</code> (please see code below), and only if that <code>WallType</code> is <code>.Corner</code> pass it a <code>Side</code> value for its orientation.
  The enums have raw values because I need to load them as numbers from a plist and be able to create them randomly.</p>
  
  <pre><code>enum Side: Int {
    case Left = 0, Right
  }
  
  enum WallType: Int {
    case Straight = 0
    case Corner(orientation: Side)
  }
  </code></pre>
  
  <p>I get the error: <strong>"Enum with raw type cannot have cases with arguments"</strong></p>
  
  <p>Is there a workaround where I can pass the SKSpriteNode a value for its orientation only when its <code>WallType</code> is <code>.Corner</code>?
  At the moment I'm initialising it with a value for orientation every time, even when it is not necessary because its <code>WallType</code> is <code>.Straight</code>.</p>
  
  <p>I guess I could make <code>Side</code> optional but then I would have to change a lot of other code where I'm using <code>Side</code> as well.
  And then, I'd still have to pass in <code>nil</code>.</p>
  
  <p>I'd like to initialise the wall like that:</p>
  
  <pre><code>let wall = Wall(ofType type: WallType)
  </code></pre>
  
  <p>The information about it's orientation should be inside the <code>WallType</code>, but only if it is <code>.Corner</code>.
  Is there a way to extend <code>WallType</code> to fit my needs?</p>
  
  <p>The suggestion made in this thread doesn't really seem to apply in my case:
  <a href="https://stackoverflow.com/questions/24171814/can-associated-values-and-raw-values-coexist-in-swift-enumeration">Can associated values and raw values coexist in Swift enumeration?</a></p>
  
  <p>Alternatively, if I decided to take away the raw value from the <code>WallType</code> enum, how would I go about loading it form a plist?</p>
  
  <p>I hope that makes sense! Thanks for any suggestions!</p>