diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 20:55:51 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 20:55:51 +0200 |
commit | cc53496bab9ad2bbfc3fb2868cd10fa46f612e69 (patch) | |
tree | f974028160c90e5a373c3ac38d8d7229c419aaa7 /src/Tank.hs | |
parent | 8f1fd98cd69659446b9fdd11c0f3d2b860d779f7 (diff) | |
download | htanks-cc53496bab9ad2bbfc3fb2868cd10fa46f612e69.tar htanks-cc53496bab9ad2bbfc3fb2868cd10fa46f612e69.zip |
Reworked Transform as a type class
Diffstat (limited to 'src/Tank.hs')
-rw-r--r-- | src/Tank.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Tank.hs b/src/Tank.hs index f3230f2..a595618 100644 --- a/src/Tank.hs +++ b/src/Tank.hs @@ -3,13 +3,12 @@ module Tank ( Tank(..) , tankY ) where -import Transformable import Vector data Tank = Tank { tankPos :: !Vertex - , tankDir :: !Vector - , tankAim :: !Vector + , tankDir :: !Rotation + , tankAim :: !Rotation , tankSpeed :: !Coord , tankTurnspeed :: !Coord , tankMoving :: !Bool @@ -26,7 +25,7 @@ tankY :: Tank -> Coord tankY = vertexY . tankPos instance Transformable Tank where - t >< tank = tank { tankPos = pos, tankDir = dir, tankAim = aim } where + transform t tank = tank { tankPos = pos , tankDir = dir, tankAim = aim } where pos = t >< tankPos tank dir = t >< tankDir tank aim = t >< tankAim tank
\ No newline at end of file |