Permalink
Browse files

fix warnings for scala 2.9.1

  • Loading branch information...
1 parent ff211d8 commit d2bdfe040a07be9e1698f62740a7091cc8cfa49b @godfat committed Sep 4, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/org/spbk/pure/Block.scala
  2. +1 −1 src/org/spbk/pure/Map.scala
  3. +2 −2 src/org/spbk/pure/Skill.scala
@@ -15,6 +15,6 @@ case class Block(val index: Int, val terrain: Terrain, val creature: Maybe[Creat
}
case Just(current_creature: Creature) =>
- error("already got a creature there: " + current_creature.toString)
+ sys.error("already got a creature there: " + current_creature.toString)
}
}
@@ -7,7 +7,7 @@ import scala.collection.immutable.TreeSet
case class Map(val width: Int, val height: Int, val blocks: TreeMap[Int, Block]){
def nearby(index: Int, step: Int = 1): List[Block] = blocks.get(index) match{
case Some(b: Block) => bfs(List((step, b)))
- case None => error("invalid block index: " + index.toString)
+ case None => sys.error("invalid block index: " + index.toString)
}
def left (b: Block): Option[Block] = blocks.get( left_index(b.index))
@@ -20,13 +20,13 @@ abstract class SkillSimple[Cost <: Property, Damage <: Property] extends Skill{
override def consume(from: Block): Block = from.creature match{
case Just(c: Creature) => Block( from.index, from.terrain, Just(c - cost(c)) )
- case _ => error("no creature for consume")
+ case _ => sys.error("no creature for consume")
}
override def apply(from: Block, to: Block): Block = (from.creature, to.creature) match{
case (Just(fc: Creature), Just(tc: Creature)) =>
Block( to.index, to.terrain, Just(tc - damage(fc, tc)) )
- case _ => error("missing creature(s)")
+ case _ => sys.error("missing creature(s)")
}
}

0 comments on commit d2bdfe0

Please sign in to comment.