📄 planetoid.java
字号:
/*
* Planetoid.java
*
* Copyright (C) 2000 Jason M. Hanley
* Released under the GNU General Public License (GPL)
* See license.txt for additional information.
*
* Created on August 4, 2000, 1:20 AM
*/
package fate.world;
import java.io.*;
import fate.*;
import fate.util.*;
/**
* Represents a planet, asteroid, or any other fixed object orbiting
* in a {@link SolarSystem}.
*
* @author preylude@s3m.com
* @version 0.1.0
*/
public class Planetoid extends OrbitingBody implements Cloneable, Serializable {
/** Map of all orbiting objects */
public MapWorldObject mapOrbiting;
/** Map of all ground objects */
public MapWorldObject mapGround;
/** Creates new Planetoid with default starting values */
public Planetoid( String name, int distance, double position, double velocity ) {
super();
this.name = name;
this.position = position;
this.distance = distance;
this.velocity = velocity;
mapOrbiting = new MapWorldObject();
mapGround = new MapWorldObject();
}
/** Creates new Planetoid */
public Planetoid() {
this( "", 0, 0.0, 0.0 );
}
/** Creates a clone suitable for sending from server to client */
public Planetoid cloneForClient() {
Planetoid clonedObject = null;
try {
clonedObject = (Planetoid)this.clone();
} catch( CloneNotSupportedException e ) {
Debug.trace( "Error: can't clone object" );
}
// If we have a parent SolarSystem, make sure it gets cloned properly
if (parent != null) {
clonedObject.parent = ((SolarSystem)parent).cloneForClient();
}
clonedObject.mapGround = null;
clonedObject.mapOrbiting = null;
return clonedObject;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -