00001 00009 using System; 00010 using System.Collections.Generic; 00011 using System.Text; 00012 00013 namespace Cubes3D 00014 { 00015 class ClientConfig 00016 { 00017 private bool FLocalGame = false; 00018 private String FMapFile = ""; 00019 private bool FRecordReplay = false; 00020 00021 private int[] FHighscore = null; 00022 00023 public ClientConfig() 00024 { 00025 FHighscore = new int[5] { -1, -1, -1, -1, -1}; 00026 } 00027 00035 public bool LocalGame 00036 { 00037 get 00038 { 00039 return FLocalGame; 00040 } 00041 00042 set 00043 { 00044 FLocalGame = value; 00045 } 00046 } 00047 00055 public String MapFile 00056 { 00057 get 00058 { 00059 return FMapFile; 00060 } 00061 00062 set 00063 { 00064 FMapFile = value; 00065 } 00066 } 00067 00075 public bool RecordReplay 00076 { 00077 get 00078 { 00079 return FRecordReplay; 00080 } 00081 00082 set 00083 { 00084 FRecordReplay = value; 00085 } 00086 } 00087 00095 public int[] Highscore 00096 { 00097 get 00098 { 00099 return FHighscore; 00100 } 00101 } 00102 00114 public int SetHighscore(int AValue) 00115 { 00116 int LResult = -1; 00117 00118 int LIndex = 0; 00119 for (LIndex = 0; LIndex < FHighscore.Length; LIndex++) 00120 { 00121 if ((AValue < FHighscore[LIndex]) || (FHighscore[LIndex] <= 0)) 00122 { 00123 LResult = LIndex; 00124 break; 00125 } 00126 } 00127 00128 if (LResult >= 0) 00129 { 00130 for (LIndex = FHighscore.Length - 1; LIndex > LResult; LIndex--) 00131 { 00132 FHighscore[LIndex] = FHighscore[LIndex - 1]; 00133 } 00134 FHighscore[LResult] = AValue; 00135 } 00136 00137 return LResult; 00138 } 00139 } 00140 }
1.5.6