[added] new source component: Solar Panel #2014
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Description
This PR adds Solar Panel as a new Source component.
It will provide power based on luminance of SColor fetched via
getMap().getColorLight(this.getPosition())
.Light must be above a set threshold otherwise power is 0 and tick frequency is 45. The threshold is set to 140.
If light is above the threshold, then power is
(light - LIGHT_THRESHOLD) / (250.0f - LIGHT_THRESHOLD) * power_source
and tick frequency is 3.Therefore, Solar Panel provides power based on the light amount. If there is less light then it will provide less power.
Blob emitted light will work, so a Solar Panel can be powered by a Lamp.
However, there is an issue where blob emitted light will go through walls.
This is partly the reason why I introduced a threshold (see above).
I might change Lamp to give less light if it has less input power.
Screenshots