diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-05 02:55:38 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-05 02:55:38 -0400 |
commit | c222d406b09de529388fcd248476e9ae258895b8 (patch) | |
tree | 9cfcc6ee29e4e88757a91f572283c714115cb6e3 /nexgb/xgbgen/go_event.go | |
parent | a5d4ad6c9d763b3d3f797075038023756c38bb28 (diff) | |
download | haven-c222d406b09de529388fcd248476e9ae258895b8.tar.gz haven-c222d406b09de529388fcd248476e9ae258895b8.tar.xz haven-c222d406b09de529388fcd248476e9ae258895b8.zip |
converting to new reply/cookie scheme
Diffstat (limited to 'nexgb/xgbgen/go_event.go')
-rw-r--r-- | nexgb/xgbgen/go_event.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go index 71252a7..41f9320 100644 --- a/nexgb/xgbgen/go_event.go +++ b/nexgb/xgbgen/go_event.go @@ -28,6 +28,14 @@ func (e *Event) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") @@ -99,6 +107,14 @@ func (e *EventCopy) Define(c *Context) { // Makes sure that this event type is an Event interface. c.Putln("func (v %s) ImplementsEvent() { }", e.EvType()) c.Putln("") + c.Putln("func (v %s) SequenceId() uint16 {", e.EvType()) + if e.Old.(*Event).NoSequence { + c.Putln("return uint16(0)") + } else { + c.Putln("return v.Sequence") + } + c.Putln("}") + c.Putln("") // Let's the XGB event loop read this event. c.Putln("func init() {") |