X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2Fexpr.py;h=9ca82ec128a98a369df1855f52aec7a86aefd47d;hp=80224760f2039f66397fa0a62d2eb53ac34bf606;hb=3674933e0881e379e9945f5477cbef187abfc871;hpb=696ad700051192e81e1b0f892b3928d1ce5c4603 diff --git a/bulletml/expr.py b/bulletml/expr.py index 8022476..9ca82ec 100644 --- a/bulletml/expr.py +++ b/bulletml/expr.py @@ -62,3 +62,8 @@ class NumberDef(object): def __repr__(self): return "%s(%r)" % (type(self).__name__, self.__original) + +class INumberDef(NumberDef): + """A NumberDef, but returns rounded integer results.""" + def __call__(self, params, rank): + return int(round(super(INumberDef, self).__call__(params, rank)))