mirror of
https://github.com/codecat/go-enet.git
synced 2025-12-08 05:59:47 +00:00
20 lines
318 B
Go
20 lines
318 B
Go
|
|
package enet
|
||
|
|
|
||
|
|
// #include <enet/enet.h>
|
||
|
|
import "C"
|
||
|
|
|
||
|
|
// Peer is a peer which data packets may be sent or received from
|
||
|
|
type Peer interface {
|
||
|
|
GetAddress() Address
|
||
|
|
}
|
||
|
|
|
||
|
|
type enetPeer struct {
|
||
|
|
cPeer *C.struct__ENetPeer
|
||
|
|
}
|
||
|
|
|
||
|
|
func (peer enetPeer) GetAddress() Address {
|
||
|
|
return &enetAddress{
|
||
|
|
cAddr: peer.cPeer.address,
|
||
|
|
}
|
||
|
|
}
|