Rev 4 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 77 | ||
---|---|---|---|
1 | /************************************ |
1 | /************************************ |
2 | * |
2 | * |
3 | * class representing the MK-Version |
3 | * class representing the MK-Version |
4 | * Author: Marcus -LiGi- Bueschleb |
4 | * Author: Marcus -LiGi- Bueschleb |
5 | * Project-Start: 9/2007 * |
5 | * Project-Start: 9/2007 * |
6 | * |
6 | * |
7 | * see README for further Infos |
7 | * see README for further Infos |
8 | * |
8 | * |
9 | ****************************************/ |
9 | ****************************************/ |
10 | 10 | ||
11 | public class MKVersion |
11 | public class MKVersion |
12 | 12 | ||
13 | { |
13 | { |
14 | public int major=-1; |
14 | public int major=-1; |
15 | public int minor=-1; |
15 | public int minor=-1; |
16 | public int compatible=-1; |
16 | public int compatible=-1; |
17 | public String str="--"; |
17 | public String str="--"; |
18 | 18 | ||
- | 19 | ||
- | 20 | // version known? |
|
- | 21 | public boolean known=false; |
|
19 | 22 | ||
20 | public final byte VERSION_AFTER=0; |
23 | public final byte VERSION_AFTER=0; |
21 | public final byte VERSION_EQUAL=1; |
24 | public final byte VERSION_EQUAL=1; |
22 | public final byte VERSION_PREVIOUS=2; |
25 | public final byte VERSION_PREVIOUS=2; |
23 | 26 | ||
24 | 27 | ||
25 | public void set_by_mk_data(int[] data) |
28 | public void set_by_mk_data(int[] data) |
26 | { |
29 | { |
27 | major=data[0]; |
30 | major=data[0]; |
28 | minor=data[1]; |
31 | minor=data[1]; |
29 | compatible=data[2]; |
32 | compatible=data[2]; |
30 | str="v"+major+"."+minor+"/"+compatible; |
33 | str="v"+major+"."+minor+"/"+compatible; |
- | 34 | known=true; |
|
31 | } |
35 | } |
32 | 36 | ||
33 | public byte compare(int major_c,int minor_c) |
37 | public byte compare(int major_c,int minor_c) |
34 | { |
38 | { |
35 | if ((major_c==major)&&(minor_c==minor)) |
39 | if ((major_c==major)&&(minor_c==minor)) |
36 | return VERSION_EQUAL; |
40 | return VERSION_EQUAL; |
37 | // TODO - compare major - PC-COMPATIBLE |
41 | // TODO - compare major - PC-COMPATIBLE |
38 | else if (minor_c>minor) return VERSION_AFTER; |
42 | else if (minor_c>minor) return VERSION_AFTER; |
39 | return VERSION_PREVIOUS; |
43 | return VERSION_PREVIOUS; |
40 | 44 | ||
41 | } |
45 | } |
42 | 46 | ||
43 | } |
47 | } |
44 | 48 |