001    package net.minecraft.world.storage;
002    
003    import cpw.mods.fml.relauncher.Side;
004    import cpw.mods.fml.relauncher.SideOnly;
005    import net.minecraft.world.EnumGameType;
006    
007    @SideOnly(Side.CLIENT)
008    public class SaveFormatComparator implements Comparable
009    {
010        /** the file name of this save */
011        private final String fileName;
012    
013        /** the displayed name of this save file */
014        private final String displayName;
015        private final long lastTimePlayed;
016        private final long sizeOnDisk;
017        private final boolean requiresConversion;
018    
019        /** Instance of EnumGameType. */
020        private final EnumGameType theEnumGameType;
021        private final boolean hardcore;
022        private final boolean cheatsEnabled;
023    
024        public SaveFormatComparator(String par1Str, String par2Str, long par3, long par5, EnumGameType par7EnumGameType, boolean par8, boolean par9, boolean par10)
025        {
026            this.fileName = par1Str;
027            this.displayName = par2Str;
028            this.lastTimePlayed = par3;
029            this.sizeOnDisk = par5;
030            this.theEnumGameType = par7EnumGameType;
031            this.requiresConversion = par8;
032            this.hardcore = par9;
033            this.cheatsEnabled = par10;
034        }
035    
036        /**
037         * return the file name
038         */
039        public String getFileName()
040        {
041            return this.fileName;
042        }
043    
044        /**
045         * return the display name of the save
046         */
047        public String getDisplayName()
048        {
049            return this.displayName;
050        }
051    
052        public boolean requiresConversion()
053        {
054            return this.requiresConversion;
055        }
056    
057        public long getLastTimePlayed()
058        {
059            return this.lastTimePlayed;
060        }
061    
062        public int compareTo(SaveFormatComparator par1SaveFormatComparator)
063        {
064            return this.lastTimePlayed < par1SaveFormatComparator.lastTimePlayed ? 1 : (this.lastTimePlayed > par1SaveFormatComparator.lastTimePlayed ? -1 : this.fileName.compareTo(par1SaveFormatComparator.fileName));
065        }
066    
067        /**
068         * Gets the EnumGameType.
069         */
070        public EnumGameType getEnumGameType()
071        {
072            return this.theEnumGameType;
073        }
074    
075        public boolean isHardcoreModeEnabled()
076        {
077            return this.hardcore;
078        }
079    
080        /**
081         * @return {@code true} if cheats are enabled for this world
082         */
083        public boolean getCheatsEnabled()
084        {
085            return this.cheatsEnabled;
086        }
087    
088        public int compareTo(Object par1Obj)
089        {
090            return this.compareTo((SaveFormatComparator)par1Obj);
091        }
092    }