-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.lisp
32 lines (23 loc) · 875 Bytes
/
classes.lisp
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
30
31
32
(in-package :server)
;; An object that has a continuation.
(deftem (cont (:conc-name nil))
cont)
;; A server socket that has a continuation.
(deftem (cont-server (:include cont stream-server-usocket)))
;; A player which both has a continuation and is the same thing as the
;; socket they are on.
(deftem (player (:conc-name nil) (:include cont stream-usocket))
game num flags)
(deftem (game (:conc-name nil))
need players game-log flags (player-type 'player))
;; Makes accessing into a game with a board easier.
(deftem (board-game (:conc-name nil) (:include game))
board)
(defmethod get ((b board-game) (p list))
(get b!board p))
(defmethod (setf get) (val (b board-game) (p list))
(= (get b!board p) val))
(defmethod get ((b board-game) (p number))
(get b!board p))
(defmethod (setf get) (val (b board-game) (p number))
(setf (get b!board p) val))