Mercurial > touhou
annotate pytouhou/game/item.pxd @ 471:06f0eeb519bb
Make Laser and Orb extension types, and use that where possible.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 16 Sep 2013 18:42:04 +0200 |
parents | feecdb4a8928 |
children | 8038f1957b71 |
rev | line source |
---|---|
446
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 from pytouhou.game.element cimport Element |
447
78e1c3864e73
Make pytouhou.game.game an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
446
diff
changeset
|
2 from pytouhou.game.game cimport Game |
446
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 from pytouhou.game.player cimport Player |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 from pytouhou.utils.interpolator cimport Interpolator |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 cdef class Indicator(Element): |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 cdef Item _item |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 |
468
feecdb4a8928
Add “except *” to cdef void functions, and type some more.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
447
diff
changeset
|
10 cdef void update(self) nogil |
446
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 cdef class Item(Element): |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 cdef public object _item_type |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 cdef unsigned long frame |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 cdef long _type |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 cdef double angle, speed |
447
78e1c3864e73
Make pytouhou.game.game an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
446
diff
changeset
|
19 cdef Game _game |
446
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 cdef Player player |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 cdef Indicator indicator |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 cdef Interpolator speed_interpolator, pos_interpolator |
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 |
468
feecdb4a8928
Add “except *” to cdef void functions, and type some more.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
447
diff
changeset
|
24 cdef void autocollect(self, Player player) except * |
feecdb4a8928
Add “except *” to cdef void functions, and type some more.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
447
diff
changeset
|
25 cdef void on_collect(self, Player player) except * |
446
3a33ed7f3b85
Make pytouhou.game.item an extension type.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 cpdef update(self) |