Library Lamp: Extracted functions.

Did this change a long time ago, probably for re-using functions in a derived object.
console-destruction
Mark 2016-09-15 19:17:17 +02:00
parent 0cdad64934
commit 58d42b8fd8
1 changed files with 15 additions and 5 deletions

View File

@ -41,25 +41,35 @@ public func LampOffset() {}
public func TurnOn()
{
if (lib_lamp_lit) return false;
_inherited();
SetLightRange(this->GetLampRange(), this->GetLampFadeRange());
SetLightColor(this->GetLampColor());
_inherited(...);
TurnLightOn();
lib_lamp_lit = true;
return true;
}
func TurnLightOn()
{
SetLightRange(this->GetLampRange(), this->GetLampFadeRange());
SetLightColor(this->GetLampColor());
}
/** Standard turning off procedure. Overload as needed.
Default behaviour: lib_lamp_lit to false, light range 0,0, inherited
*/
public func TurnOff()
{
if (!lib_lamp_lit) return false;
_inherited();
SetLightRange(0, 0);
_inherited(...);
TurnLightOff();
lib_lamp_lit = false;
return true;
}
func TurnLightOff()
{
SetLightRange(0, 0);
}
// Returns whether the lamp currently is a source of light.
public func IsLightSource()
{