Difference between revisions of "Oolite JavaScript Reference: Planet"
From Elite Wiki
(New page: <small>'''Prototype:''' <code>Entity</code></small><br /> <small>'''Subtypes:''' none {{Oolite-future-scripting}} The '''<code>Planet</code>...) |
m |
||
Line 8: | Line 8: | ||
== Properties == |
== Properties == |
||
=== isMainPlanet === |
=== isMainPlanet === |
||
− | '''isMainPlanet''' : Boolean |
+ | '''isMainPlanet''' : Boolean (read-only) |
<code>true</code> if the entity is the main planet of the current system, <code>false</code> otherwise. |
<code>true</code> if the entity is the main planet of the current system, <code>false</code> otherwise. |
||
=== isSun === |
=== isSun === |
||
− | '''isSun''' : Boolean |
+ | '''isSun''' : Boolean (read-only) |
<code>true</code> if the entity is the sun of the current system, <code>false</code> otherwise. |
<code>true</code> if the entity is the sun of the current system, <code>false</code> otherwise. |
||
=== hasAtmosphere === |
=== hasAtmosphere === |
||
− | '''hasAtmosphere''' : Boolean |
+ | '''hasAtmosphere''' : Boolean (read-only) |
<code>true</code> if the entity has an atmosphere, <code>false</code> otherwise. The sun and planets created with the <code>System.[[Oolite/Development/Scripting/Class/System#addMoon|addMoon]]()</code> method (or corresponding legacy scripting method) have no atmosphere, other planets do. |
<code>true</code> if the entity has an atmosphere, <code>false</code> otherwise. The sun and planets created with the <code>System.[[Oolite/Development/Scripting/Class/System#addMoon|addMoon]]()</code> method (or corresponding legacy scripting method) have no atmosphere, other planets do. |
||
=== radius === |
=== radius === |
||
− | '''radius''' : Number |
+ | '''radius''' : Number (read-only) |
The equatorial radius of the planet, in metres. |
The equatorial radius of the planet, in metres. |
Revision as of 15:39, 8 October 2007
Prototype: Entity
Subtypes: none
The Planet
class is an Entity
representing a celestial body. Just as a Ship
may in fact be an asteroid, a Planet
may be the sun. A Planet
has all the properties and methods of a Entity
, and several others.
Properties
isMainPlanet
isMainPlanet : Boolean (read-only)
true
if the entity is the main planet of the current system, false
otherwise.
isSun
isSun : Boolean (read-only)
true
if the entity is the sun of the current system, false
otherwise.
hasAtmosphere
hasAtmosphere : Boolean (read-only)
true
if the entity has an atmosphere, false
otherwise. The sun and planets created with the System.addMoon()
method (or corresponding legacy scripting method) have no atmosphere, other planets do.
radius
radius : Number (read-only)
The equatorial radius of the planet, in metres.