phetsims / greenhouse-effect

"Greenhouse Effect" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 4 forks source link

Documentation for some fields #338

Closed pixelzoom closed 11 months ago

pixelzoom commented 11 months ago

For code review https://github.com/phetsims/greenhouse-effect/issues/331 ...

Code documentation is generally excellent. There are a few places where explanation of fields would be useful.


public readonly dt: number;
public readonly energy: number;
public static readonly FULLY_ABOVE = new PhotonCrossingTestResult();
public static readonly FULLY_BELOW = new PhotonCrossingTestResult();
public static readonly CROSSED_BUT_IGNORED = new PhotonCrossingTestResult();
public static readonly CROSSED_AND_ABSORBED = new PhotonCrossingTestResult();
public static readonly NONE = new PhotonCrossingTestResult();
public readonly photons: ObservableArray<Photon>;
public readonly photonAbsorbingEmittingLayers: PhotonAbsorbingEmittingLayer[];
public readonly showAllSimulatedPhotonsInViewProperty: BooleanProperty;
private readonly sunEnergySource: SunEnergySource;
private readonly groundLayer: GroundLayer;
private readonly glacierPresentProperty: TReadOnlyProperty<boolean>;
private photonCreationCountdown: number;
private groundPhotonProductionRate: number;
private groundPhotonProductionTimeAccumulator: number;
private visiblePhotonCreationCount: number;
private infraredPhotonCreationCount: number;
private interBlipTime: number = Number.POSITIVE_INFINITY;
private interBlipCountdown: number = Number.POSITIVE_INFINITY;
private readonly photonScale: number;
private readonly visiblePhotonSprite: Sprite;
private readonly infraredPhotonSprite: Sprite;
public readonly waveGroup: PhetioGroup<Wave, WaveCreatorArguments>;
public readonly wavesChangedEmitter: TEmitter;
private readonly sunWaveSource: SunWaveSource;
private readonly groundWaveSource: GroundWaveSource;
private cloudReflectedWavesMap: Map<Wave, Wave>;
private glacierReflectedWavesMap: Map<Wave, Wave>;
private readonly atmosphereLayerToXRangeMap: Map<EnergyAbsorbingEmittingLayer, Range>;
public readonly waveAtmosphereInteractions: ObservableArray<WaveAtmosphereInteraction>;
private readonly waveLineStart: Vector2;
private readonly waveLineEnd: Vector2;
private readonly waveLine: Line;
private readonly atmosphereLineStart: Vector2;
private readonly atmosphereLineEnd: Vector2;
private readonly atmosphereLine: Line;
public readonly xPosition: number;
public readonly propagationDirection: Vector2;
type RenderingParameters = {
  baseColorProperty: ColorProperty;
  amplitude: number;
  wavelength: number;
};
…
private readonly waveRenderingParameters: Map<number, RenderingParameters>;
jbphet commented 11 months ago

The requested documentation has been added. @pixelzoom - you're of course welcome to take a look when you see this go by, but I was pretty thorough in my comments and tackled everything listed, so I'm going to go ahead and close this.