001 package com.croftsoft.apps.mars.model.seri; 002 003 import java.io.Serializable; 004 005 import com.croftsoft.apps.mars.model.Model; 006 007 /********************************************************************* 008 * The base abstract class for a game world object Model. 009 * 010 * @version 011 * 2003-04-16 012 * @since 013 * 2003-03-30 014 * @author 015 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 016 *********************************************************************/ 017 018 public abstract class SeriModel 019 implements Comparable, Model, Serializable 020 ////////////////////////////////////////////////////////////////////// 021 ////////////////////////////////////////////////////////////////////// 022 { 023 024 private static final long serialVersionUID = 0L; 025 026 ////////////////////////////////////////////////////////////////////// 027 // interface Comparable method 028 ////////////////////////////////////////////////////////////////////// 029 030 public int compareTo ( Object other ) 031 ////////////////////////////////////////////////////////////////////// 032 { 033 double otherZ = ( ( Model ) other ).getZ ( ); 034 035 double z = getZ ( ); 036 037 if ( z < otherZ ) 038 { 039 return -1; 040 } 041 042 if ( z > otherZ ) 043 { 044 return 1; 045 } 046 047 return 0; 048 } 049 050 ////////////////////////////////////////////////////////////////////// 051 ////////////////////////////////////////////////////////////////////// 052 }