com.jme3.util.clone.JmeCloneable Java Examples

The following examples show how to use com.jme3.util.clone.JmeCloneable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Animation.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override   
public void cloneFields( Cloner cloner, Object original ) {
     
    // There is some logic here that I'm copying but I'm not sure if
    // it's a mistake or not.  If a track is not a CloneableTrack then it
    // isn't cloned at all... even though they all implement clone() methods. -pspeed
    SafeArrayList<Track> newTracks = new SafeArrayList<>(Track.class);
    for( Track track : tracks ) {
        if (track instanceof JmeCloneable) {
            newTracks.add(cloner.clone(track));
        } else {
            // this is the part that seems fishy 
            newTracks.add(track);
        }
    }
    this.tracks = newTracks;
}