Mercurial > projects > chipmunkd
diff trunk/chipmunkd/chipmunk_types.d @ 17:131331ebb599
cpVect toString method and some cleanup
author | Extrawurst |
---|---|
date | Thu, 09 Dec 2010 01:51:30 +0100 |
parents | df4ebc8add66 |
children | 4ceef5833c8c |
line wrap: on
line diff
--- a/trunk/chipmunkd/chipmunk_types.d Sat Dec 04 02:02:29 2010 +0100 +++ b/trunk/chipmunkd/chipmunk_types.d Thu Dec 09 01:51:30 2010 +0100 @@ -3,6 +3,8 @@ module chipmunkd.chipmunk_types; +import std.string; + //#ifdef __APPLE__ // #import "TargetConditionals.h" //#endif @@ -100,7 +102,15 @@ // #import <CoreGraphics/CGGeometry.h> // typedef CGPoint cpVect; //#else - struct cpVect{cpFloat x = 0; cpFloat y=0;} + struct cpVect + { + cpFloat x = 0; cpFloat y=0; + + string toString() const + { + return .format("(%s,%s)",x,y); + } + } //#endif alias uint cpHashValue;