forked from Mirrors/openclonk
Library Lamp: Extracted functions.
Did this change a long time ago, probably for re-using functions in a derived object.console-destruction
parent
0cdad64934
commit
58d42b8fd8
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue