Created
March 14, 2014 16:48
-
-
Save benjaminjackman/9551659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ItemContainer { | |
implicit class ItemContainerExtensions(val ic: ItemContainer) extends AnyVal { | |
def allItems(character: Option[String]): List[AnyItem] = { | |
ic.items.toList.flatMap { item => | |
(item :: item.socketedItems.toList.map { i => | |
i.inItem = item | |
i | |
}) map { i => | |
character.foreach(c => i.character = c.toJs.asJsStr) | |
i.locationId = i.getLocationId.toJs.asJsStr | |
i | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment