src/caves/entities/aspects/mobile.clj @ 811f328099c6
Real attacking, and some refactoring.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 17 Jul 2012 23:22:14 -0400 |
parents |
180b5b981d92 |
children |
1a3a4f8d5d85 |
(ns caves.entities.aspects.mobile
(:use [caves.entities.core :only [defaspect]]
[caves.world :only [is-empty?]]))
(defaspect Mobile
(move [this dest world]
{:pre [(can-move? this dest world)]}
(assoc-in world [:entities (:id this) :location] dest))
(can-move? [this dest world]
(is-empty? world dest)))