27 |
(define game |
(define game |
28 |
([] ([] "HgGame" alloc) initWithName: ($$ "meuh"))) |
([] ([] "HgGame" alloc) initWithName: ($$ "meuh"))) |
29 |
(equal? ship ([] ship initWithGame: game |
(equal? ship ([] ship initWithGame: game |
30 |
position: '(1.5 2.0 6.0) |
position: '(1.5 2.0 6.0) |
31 |
velocity: '(5.75 6.5 7.0) |
velocity: '(5.75 6.5 7.0) |
32 |
angularVelocity: '(8.5 9.0 10.0) |
angularVelocity: '(8.5 9.0 10.0) |
33 |
acceleration: 5.0 |
acceleration: 5.0 |
34 |
direction: 11.0)))) |
direction: 11.0)))) |
35 |
|
|
36 |
(greg-testcase "HgShip fuel accessors" #t |
(greg-testcase "HgShip fuel accessors" #t |
37 |
(lambda () |
(lambda () |
38 |
([] ship setFuel: 21) |
([] ship setFuel: 21) |
39 |
(equal? 20 ([] ship fuel)))) |
(equal? 21 ([] ship fuel)))) |
40 |
|
|
41 |
(greg-testcase "HgShip fireRate accessor" #t |
(greg-testcase "HgShip fireRate accessors" #t |
42 |
(lambda () |
(lambda () |
43 |
|
([] ship setFireRate: 29) |
44 |
(equal? 29 ([] ship fireRate)))) |
(equal? 29 ([] ship fireRate)))) |
45 |
|
|
46 |
(greg-testcase "HgShip weapons accessor" #t |
(greg-testcase "HgShip nbammos accessors" #t |
47 |
(lambda () |
(lambda () |
48 |
(equal? ([] ship weapons)))) |
([] ship setNbAmmo: 40) |
49 |
|
(equal? 40 ([] ship nbAmmos)))) |
50 |
|
|
51 |
(greg-testcase "HgShip capacities1 accessor" #t |
(greg-testcase "HgShip useAmmos method" #t |
52 |
(lambda () |
(lambda () |
53 |
(equal? ([] ship capacities1)))) |
([] ship useAmmos: 5) |
54 |
|
(equal? 35 ([] ship nbAmmos)))) |
|
(greg-testcase "HgShip capacities2 accessor" #t |
|
|
(lambda () |
|
|
(equal? ([] ship capacities2)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(greg-testcase "HgShip nbAmmos accessor" #t |
|
|
; (lambda () |
|
|
; ([] ship setPosition: '(4.0 5.0 6.5)) |
|
|
; (equal? '(4.0 5.0 6.5) ([] ship position)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(greg-testcase "HgShip orientation accessors" #t |
|
|
; (lambda () |
|
|
; ([] ship setOrientation: '(2.0 3.0 7.0)) |
|
|
; (equal? '(2.0 3.0 7.0) ([] ship orientation)))) |
|
|
|
|
55 |
|
|
56 |
|
|
|
;(greg-testcase "HgShip position after initialisation" #t |
|
|
; (lambda () |
|
|
; (equal? 29 ([] ship fireRate)))) |
|