Gleeok wrote:[Thread Hijacking In Progress]Ooh boy, oh boy. A discussion about getters/setters and abstraction layers! Quick, post the offending code. We've got to figure this out immediately! :P
This edisode of 'Is it sarcasm' has been brought to you by Gleeok. Click here to see the answer:
[spoiler]
No. Not sarcasm. Haha. Fooled you.
[/spoiler]
[/Thread Hijacking In Progress]
I did them the same way that the other interface getters work:
[spoiler]
case GAMETHROTTLE:
ret=Throttlefps?10000:0;
break;
case GAMEPAUSED:
ret=Paused?10000:0;
break;
case GAMEPLAYING:
ret=Playing?10000:0;
break;
case GAMEHEARTBEEP:
ret=heart_beep?10000:0;
break;
case ONCONVEY:
ret=is_on_conveyor?10000:0;
break;
case ACTTIMEDWARP:
ret=activated_timed_warp?10000:0;
break;
case GOFAST:
ret=gofast?10000:0;
break;
case GETZCVERSION:
ret=zcversion*10000;
break;
{ "getVersion", ScriptParser::TYPE_FLOAT, GETTER, GETZCVERSION, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getGoFast", ScriptParser::TYPE_BOOL, GETTER, GOFAST, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getActTimedWarp", ScriptParser::TYPE_BOOL, GETTER, ACTTIMEDWARP, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getHeartbeep", ScriptParser::TYPE_BOOL, GETTER, GAMEHEARTBEEP, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getCapFPS", ScriptParser::TYPE_BOOL, GETTER, GAMETHROTTLE, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "setCapFPS", ScriptParser::TYPE_VOID, SETTER, GAMETHROTTLE, 1, { ScriptParser::TYPE_GAME, ScriptParser::TYPE_BOOL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getPaused", ScriptParser::TYPE_BOOL, GETTER, GAMEPAUSED, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "getShowFPS", ScriptParser::TYPE_BOOL, GETTER, GAMESHOWFPS, 1, { ScriptParser::TYPE_GAME, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
{ "setHasPlayed", ScriptParser::TYPE_VOID, SETTER, GAMEHASPLAYED, 1, { ScriptParser::TYPE_GAME, ScriptParser::TYPE_BOOL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
[/spoiler]
I had to cut out some to get that to fit, such as GetPressF4.
Most of those that I cut are probably useless, but I just shoved all the interface vars in there when I did a few of them, so that I would never have to do them again. If for some reason anyone wants to add an intermediate register, that's fine, but in these cases, I think it's pretty pointless.
I may have lost the file with Set/GetDMapScreenDoor, Set/GetScreenDoor, Set/getScreenState, Set/etDMapScreenState, and a lot of other general purpose getters and setters for that sort of thing, that otherwise work exactly as GetScreenD, SetScreenD, GetDMapScreenD, SetDMapScreenD, and so forth; that would take all of an hour to write up again. I should have it archived, but I don't know where... It was on the drive that fried, and it'd be faster to rewrite it, than to find it on the servers.