src/caves/entities/aspects/mobile.clj @ b894c3ffe436

what have I done?
author Steve Losh <steve@stevelosh.com>
date Sat, 14 Jul 2012 00:31:26 -0400
parents 35acf92fe597
children 180b5b981d92
(ns caves.entities.aspects.mobile
  (:use [caves.entities.core :only [defaspect]]
        [caves.world :only [is-empty?]]))



(defaspect Mobile
  (move [this world dest]
    {:pre [(can-move? this world dest)]}
    (assoc-in world [:entities (:id this) :location] dest))
  (can-move? [this world dest]
    (is-empty? world dest)))