File tree Expand file tree Collapse file tree 11 files changed +50
-54
lines changed
src/clecs_tetris/world/system
test/clecs_tetris/world/system Expand file tree Collapse file tree 11 files changed +50
-54
lines changed Original file line number Diff line number Diff line change 44 :license {:name " GNU GPL v3"
55 :url " http://www.gnu.org/licenses/gpl-3.0.en.html" }
66 :dependencies [[org.clojure/clojure " 1.6.0" ]
7- [clecs " 1.0.2 -SNAPSHOT" ]
8- [seesaw " 1.4.4 " ]]
7+ [clecs " 1.1.0 -SNAPSHOT" ]
8+ [seesaw " 1.4.5 " ]]
99 :main ^:skip-aot clecs-tetris.core
1010 :target-path " target/%s"
1111 :profiles {:dev {:dependencies [[midje " 1.6.3" ]]}
Original file line number Diff line number Diff line change 33 [clecs.world :as world]
44 [clecs-tetris.world.component :refer [->CurrentShapeComponent
55 ->GlassTileComponent
6- ->TargetLocationComponent]])
7- (:import [clecs_tetris.world.component
8- CurrentShapeComponent
9- GlassTileComponent
10- TargetLocationComponent]))
6+ ->TargetLocationComponent
7+ CurrentShapeComponent
8+ GlassTileComponent
9+ TargetLocationComponent]]))
1110
1211
1312(declare -move-target-location )
Original file line number Diff line number Diff line change 11(ns clecs-tetris.world.system.new-shape
22 (:require [clecs-tetris.world.component :refer [->CurrentShapeComponent
3- ->TargetLocationComponent]]
3+ ->TargetLocationComponent
4+ CurrentShapeComponent
5+ NextShapeComponent
6+ TargetLocationComponent]]
47 [clecs.query :as query]
5- [clecs.world :as world])
6- (:import (clecs_tetris.world.component CurrentShapeComponent
7- NextShapeComponent
8- TargetLocationComponent)))
8+ [clecs.world :as world]))
99
1010
1111(defn -can-create-new-shape? [w]
Original file line number Diff line number Diff line change 11(ns clecs-tetris.world.system.next-shape
2- (:require [clecs-tetris.world.component :refer [->NextShapeComponent]]
2+ (:require [clecs-tetris.world.component :refer [->NextShapeComponent
3+ NextShapeComponent]]
34 [clecs.query :as query]
4- [clecs.world :as world])
5- (:import (clecs_tetris.world.component NextShapeComponent)))
5+ [clecs.world :as world]))
66
77
88(defn -add-shape [shape]
Original file line number Diff line number Diff line change 11(ns clecs-tetris.world.system.rendering
2- (:require [clecs-tetris.world.component]
2+ (:require [clecs-tetris.world.component :refer [GlassTileComponent
3+ LevelComponent
4+ LinesDroppedComponent
5+ NextShapeComponent
6+ ScoreComponent]]
37 [clecs-tetris.world.protocol :as protocol]
48 [clecs.query :as query]
5- [clecs.world :as world])
6- (:import (clecs_tetris.world.component GlassTileComponent
7- LevelComponent
8- LinesDroppedComponent
9- NextShapeComponent
10- ScoreComponent)))
9+ [clecs.world :as world]))
1110
1211
1312(defn -get-next-shape [w]
Original file line number Diff line number Diff line change 11(ns clecs-tetris.world.system.update-shape
22 (:require [clecs-tetris.world.component :refer [->CurrentShapeComponent
33 ->GlassTileComponent
4- ->TargetLocationComponent]]
4+ ->TargetLocationComponent
5+ CurrentShapeComponent
6+ GlassTileComponent
7+ TargetLocationComponent]]
58 [clecs.query :as query]
6- [clecs.world :as world])
7- (:import (clecs_tetris.world.component CurrentShapeComponent
8- GlassTileComponent
9- TargetLocationComponent)))
9+ [clecs.world :as world]))
1010
1111
1212(defn -set-glass-tile [w x y tile]
Original file line number Diff line number Diff line change 1010 [clecs.world :as world]
1111 [clecs-tetris.world.component :refer [->CurrentShapeComponent
1212 ->GlassTileComponent
13- ->TargetLocationComponent]]
13+ ->TargetLocationComponent
14+ CurrentShapeComponent
15+ GlassTileComponent
16+ TargetLocationComponent]]
1417 [clecs-tetris.world.system.gravity :refer :all ]
15- [midje.sweet :refer :all ])
16- (:import [clecs_tetris.world.component CurrentShapeComponent
17- GlassTileComponent
18- TargetLocationComponent]))
18+ [midje.sweet :refer :all ]))
1919
2020
2121
Original file line number Diff line number Diff line change 99 [clecs.world :as world]
1010 [clecs-tetris.world.component :refer [->CurrentShapeComponent
1111 ->NextShapeComponent
12- ->TargetLocationComponent]]
12+ ->TargetLocationComponent
13+ CurrentShapeComponent
14+ NextShapeComponent
15+ TargetLocationComponent]]
1316 [clecs-tetris.world.system.new-shape :refer :all ]
14- [midje.sweet :refer :all ])
15- (:import [clecs_tetris.world.component
16- CurrentShapeComponent
17- NextShapeComponent
18- TargetLocationComponent]))
17+ [midje.sweet :refer :all ]))
1918
2019
2120(fact " -can-create-new-shape? does nothing if there is a current shape."
Original file line number Diff line number Diff line change 77 mock-world]]
88 [clecs.query :as query]
99 [clecs.world :as world]
10- [clecs-tetris.world.component :refer [->NextShapeComponent]]
10+ [clecs-tetris.world.component :refer [->NextShapeComponent
11+ NextShapeComponent]]
1112 [clecs-tetris.world.system.next-shape :refer :all ]
12- [midje.sweet :refer :all ])
13- (:import [clecs_tetris.world.component NextShapeComponent]))
13+ [midje.sweet :refer :all ]))
1414
1515
1616(fact " -add-shape creates transaction that adds a new NextShapeComponent."
Original file line number Diff line number Diff line change 88 ->LinesDroppedComponent
99 ->NextShapeComponent
1010 ->ScoreComponent
11- ->GlassTileComponent]]
11+ ->GlassTileComponent
12+ LevelComponent
13+ LinesDroppedComponent
14+ NextShapeComponent
15+ ScoreComponent
16+ GlassTileComponent]]
1217 [clecs-tetris.world.system.rendering :refer :all ]
13- [midje.sweet :refer :all ])
14- (:import [clecs_tetris.world.component
15- LevelComponent
16- LinesDroppedComponent
17- NextShapeComponent
18- ScoreComponent
19- GlassTileComponent]))
18+ [midje.sweet :refer :all ]))
2019
2120
2221(fact " -get-next-shape returns 4x4 tile grid of next shape."
You can’t perform that action at this time.
0 commit comments