src/caves/entities/aspects/mobile.clj @ 180b5b981d92
use the black magic everywhere
author |
Steve Losh <steve@stevelosh.com> |
date |
Sat, 14 Jul 2012 14:32:49 -0400 |
parents |
b894c3ffe436 |
children |
811f328099c6 |
(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)))