X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml%2Fexpr.py;h=9ca82ec128a98a369df1855f52aec7a86aefd47d;hp=80224760f2039f66397fa0a62d2eb53ac34bf606;hb=181030a9517b3742250dadbf6df7ed633b50831e;hpb=2e1e64f1f8076dd21a5ea1e7f8af6dbb74946d57 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)))