public class Atom
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
ArthromorphPerson |
genome |
| Constructor and Description |
|---|
Atom(AtomKind kind,
ArthromorphPerson genome) |
Atom(AtomKind kind,
double height,
double width,
double angle,
Atom nextLikeMe,
Atom firstBelowMe) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
Atom |
copy() |
Atom |
copyExceptNext() |
int |
countAtoms()
Recursively traverse tree of atoms to calculate the total number of atoms in the tree.
|
boolean |
doDelete()
Original Documentation
|
void |
draw(java.awt.Graphics2D g2,
double[] params,
int x,
int y,
int xCenter,
int ySeg)
The original implmentation could change the value of the variable parameter called ySeg.
|
void |
drawOval(java.awt.Graphics2D g2,
int x,
int y,
int width,
int height) |
double |
getAngle() |
Atom |
getFirstBelowMe() |
double |
getHeight() |
AtomKind |
getKind() |
Atom |
getNextLikeMe() |
double |
getWidth() |
void |
kill()
Original Documentation
|
void |
setAngle(double angle) |
void |
setFirstBelowMe(Atom firstBelowMe) |
void |
setHeight(double height) |
void |
setKind(AtomKind kind) |
void |
setNextLikeMe(Atom nextLikeMe) |
void |
setWidth(double width) |
java.util.Vector<Atom> |
toVector() |
public ArthromorphPerson genome
public Atom(AtomKind kind, ArthromorphPerson genome)
public AtomKind getKind()
public void setKind(AtomKind kind)
public double getHeight()
public void setHeight(double height)
public double getWidth()
public void setWidth(double width)
public double getAngle()
public void setAngle(double angle)
public Atom getNextLikeMe()
public void setNextLikeMe(Atom nextLikeMe)
public Atom getFirstBelowMe()
public void setFirstBelowMe(Atom firstBelowMe)
public int countAtoms()
In Classic Arthromorphs, the NextLikeMe field for AnimalTrunk was used to store the gradient gene. In the Java version, gradient is separately tracked in the Arthromorph class. For this reason, the "kind <> AnimalTrunk" check is not needed.
function CountAtoms (which: integer): integer;
{travel over the Animal, counting Atoms}
var
count: integer;
begin
count := 1; {count me}
with BoneYard[which]^^ do
begin
if FirstBelowMe <> 0 then
count := count + CountAtoms(FirstBelowMe);
if (NextLikeMe <> 0) and (kind <> AnimalTrunk) then
count := count + CountAtoms(NextLikeMe);
end;
CountAtoms := count; {Me and all below me}
end;
aa - public java.util.Vector<Atom> toVector()
public void kill()
Destroy this animal. Mark all of its Atoms as Free again.
Recursively step through the animal
public java.lang.Object clone()
clone in class java.lang.Objectpublic Atom copy()
public Atom copyExceptNext()
public boolean doDelete()
Delete a section of the animal somewhere near the atom which.
Caller must correct the AtomCount of the whole animal. Return false if failed
Must have a hold on the atom above what we delete. If chosen atom is:
AnimalTrunk delete first Sec
AnimalJoint delete first Sec
AnimalClaw delete first Sec
SectionTrunk delete next Sec
SectionJoint delete first Seg
SectionClaw delete first Seg
SegmentTrunk delete next Seg
SegmentJoint delete first Joint
SegmentClaw delete first Joint
Joint delete next Joint
Joint delete next Joint
Joint delete Claw
Claw fail
Also fail if trying to delete last example of a Kind
public void draw(java.awt.Graphics2D g2,
double[] params,
int x,
int y,
int xCenter,
int ySeg)
throws ArthromorphGradientExceeds1000Exception
params - x - y - xCenter - ArthromorphGradientExceeds1000Exceptionpublic void drawOval(java.awt.Graphics2D g2,
int x,
int y,
int width,
int height)