Implement MILLISEC system variable

This commit is contained in:
otya128 committed 2016-12-16 23:14:35 +09:00
1 parent e106374bb6
commit b4d283daad
2 files changed
+10

No files matched your search

+1
View File
@@ -228,6 +228,7 @@ class Compiler
addSystemVariable("TABSTEP", new TabStep());
addSystemVariable("RESULT", new Result());
addSystemVariable("HARDWARE", new Hardware());
addSystemVariable("MILLISEC", new MilliSecond());
}
void addSystemVariable(wstring name, SystemVariable var)
{
+9
View File
@@ -124,3 +124,12 @@ class Hardware : SystemVariable
return Value(cast(int)vm.petitcomputer.hardware);
}
}
class MilliSecond : SystemVariable
{
@property
override Value value()
{
import derelict.sdl2.sdl;
return Value(cast(int)SDL_GetTicks());
}
}