diff --git a/src/kernel/net/Package.hx b/src/kernel/net/Package.hx index 665ae57..7d2dd33 100644 --- a/src/kernel/net/Package.hx +++ b/src/kernel/net/Package.hx @@ -1,5 +1,7 @@ package kernel.net; +import lib.Pos3; + typedef NetworkID = Int; enum PackageTypes { @@ -9,6 +11,8 @@ enum PackageTypes { RouteDiscover(reachableIDs: Array<{id:NetworkID,cost:Int}>); RouteDiscoverResponse(reachableIDs: Array<{id:NetworkID,cost:Int}>); RouteDiscoverUpdate(reachableIDs: Array<{id:NetworkID,cost:Int}>); + GPSResponse(pos:Pos3); + GPSRequest(); } /** @@ -22,6 +26,15 @@ enum PackageTypes { public final data:Dynamic; public var ttl: Int; + public function new(fromID:NetworkID, toID:NetworkID, msgID:Int, type:PackageTypes, data:Dynamic, ttl:Int) { + this.fromID = fromID; + this.toID = toID; + this.msgID = msgID; + this.type = type; + this.data = data; + this.ttl = ttl; + } + /** Create package that can be used as a response. **/