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
// before | |
override def receive(ev: AnyRef)(implicit self: ItemValue) = ev match { | |
case ev: MsgItems.ApplyAction if ev.getChoice == ActionChoice.Activate => | |
if (ev.getArgsCount > 0) { | |
val arg = ev.getArgs(0) | |
cfg.targets.lift(arg) match { | |
case Some(target) => | |
items.syncBroadcast(SyncToolForUpgrade(typeId = target.toolTypeId)).info match { | |
case Some(tool) => | |
target.nextUpgrade(upgradesHave = tool.upgrades) match { |
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
trait Request { | |
def getParam(key: String): String | |
def getCommaParamList(key: String): Seq[String] | |
def paramOpt[T](key: String)(implicit reader: ParamReader[T]): Option[T] = Option(getParam(key)).map(reader.read) | |
def paramOpt[T](key: String, op: T => _)(implicit reader: ParamReader[T]): Unit = paramOpt(key).foreach(op) | |
def param[T](key: String)(implicit reader: ParamReader[T]): T = reader.read(getParam(key)) | |
def param[T](key: String, op: T => _)(implicit reader: ParamReader[T]): Unit = op(param(key)) | |
def paramExists(key: String): Boolean = getParam(key) != null | |
def paramExists(key: String, op: Boolean => _): Unit = op(paramExists(key)) |
NewerOlder