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