-
Notifications
You must be signed in to change notification settings - Fork 1
/
player-intf.rkt
30 lines (22 loc) · 1.11 KB
/
player-intf.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#lang racket
;; ---------------------------------------------------------------------------------------------------
;; an interface specification for an automated Acquire player module
;; see admin-intf for the actual player interface (player/c)
(require "admin-intf.rkt" "basics.rkt" "board.rkt" "strategy-intf.rkt" "Lib/contract.rkt")
(interface player&
[player? (-> any/c boolean?)]
[create (-> string? strategy/c (instanceof/c player/c))])
;; aadditional functions for testing
(interface player-extra&
[test
;; test a stragey on a specific board, the player's cash, the player's tiles, and available shares
(-> strategy/c board? cash? (listof tile?) shares? (listof hotel?)
;; the tester: takes board, the player created from cash and tiles, and
;; tests the player's choices of tiles and hotels to be acquired
(-> board? player/c (-> (maybe/c tile?) (maybe/c hotel?) shares-order/c any))
any)]
;; --- externalize results of player's turn actions
[xaction?
(-> any/c boolean?)]
[action->xexpr
(-> (maybe/c tile?) (maybe/c hotel?) shares-order/c xaction?)])